Sign in
Home
Online Classes
Instructors
Tutorials
☰
Register
Sign in
Online Classes
Instructors
Tutorials
1. Game set up
2. (Group activity) Y Speed (c)
3. Program a jump
4. (Group activity) An infinite game (c)
5. Design and clone obstacles
6. Program scrolling obstacles
7. Run into obstacles
8. Add a score
9. Design and clone collectibles
10. Program scrolling collectibles
11. (Optional) Multiple collectibles
12. (Optional) Scrolling background
Project 544: Infinite Runner
3. Program a jump
Using what we learned in the last step, can you program a jump? Try putting the blocks in the correct order yourself before opening up the hints!
Starting point file for this challenge
Your goal
Hint: show steps
Steps
1. Add a "when green flag clicked" to the player
Hint: show details
This is a yellow "events" block.
Hint: show image
2. Start by checking if the player is pressing the space key
Hint: show details
Grab an "if-then" block from "control." Connect this beneath the yellow block. Then, find a light blue "sensing" block called "key __ pressed" and put it in the "if" blank.
Hint: show image
3. If so, then set Y Speed to 12 as a result
Hint: show details
Put your block that says "set Y speed to 12" inside the "then" blank.
Hint: show image
4. Change Y by Y Speed as another result
Hint: show details
Put your block that says "change Y by Y Speed" inside the "then" blank.
Hint: show image
5. Put the "repeat until" as another result
Hint: show details
Put your block that says "Repeat until touching ground" inside the "then" blank.
Hint: show image
6. Put the falling down blocks in the "repeat until touching ground" block
Hint: show details
Put your remaining "change Y speed by -1" and "change Y by Y Speed" blocks into the repeat loop.
Hint: show image
7. Repeat your code with a forever loop
Hint: show details
Finally, put your forever loop around the entire code!
Hint: show image
×
×
Provide your email address for immediate project access
Email
Check your email for instructions on how to create a full DA account