Introduction to Functions
Activity
A. Go to placeSprite.
B. Go to Activity: Functions Intro.
Complete Student Tasks 1a-1b.
Tasks
Task 1a
- Create three different functions.
- Call functions in on start.
- Comment your code.
Shared project link:
Task 1 Extension
Recreate code using JavaScript.
Shared project link:
β―
Tasks 1b
- Create 2 new functions.
- Call functions in on A button pressed.
- Comment your code.
Shared project link:
Task 1b Challenge
Create an overlap event that uses:
- the conversation function.
- an additional, new function.
Shared project link:
Task 1b Extension
Recreate code using JavaScript.
Shared project link:
Extension activities
- Complete the problem set at Problem Set: Intro to Functions.
- You may use block or text based programming for the problem sets.
- Comment your code as your work.
Reflection/Homework
Describe how using functions in code can help make programming easier. Does putting code into separate functions always make sense? Would it be more or less clear if we took the code from our example (placeHuman, placeCow, and placeAsteroid) and made a function that calls the other three, so that our on start block only had a single block inside of it?