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
7. Run into obstacles
If your player runs into an obstacle, the game should end.
Starting point file for this challenge
Your goal
Hint: show steps
Steps
1. Add another "when green flag clicked" on the player
Hint: show details
This is a yellow "events" block. Add this to the player sprite.
Hint: show image
2. Check if it's touching the obstacle
Hint: show details
Use an if-statement. An "if-then" block is found in the "control" section.
Then, use a light blue "sensing" block to fill out the condition. You'll want "touching ___" inside of the "if" blank.
Change it to check if it's touching your obstacle sprite.
Hint: show image
3. If so, then add a "stop all" as a result
Hint: show details
Grab a "stop all" block from the "control" section and drop it in the "then" blank.
Hint: show image
4. Repeat the code forever
Hint: show details
Put a forever loop from the "control" section around the entire if-statement.
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