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
10. Program scrolling collectibles
The collectibles should also move from one side of the screen to the other, and add a point to the score every time the player touches one.
Starting point file for this challenge
Your goal
Hint: show steps
Steps
1. Duplicate the scrolling code from the obstacle over
Hint: show details
Go back into your obstacle's code. Find the piece of code that the clones to move. Click and drag this over your collectible sprite. Wait until the sprite wiggles! Then, let go. It should be copied into your other sprite now.
Hint: show image
2. Add another "when I start as a clone" block
Hint: show details
This is from the "control" section.
Hint: show image
3. Check if it's touching the player
Hint: show details
Use an if-statement. An "if-then" block is in the "control" section.
Find a light blue sensing block called "touching __" and put it in the "if" blank. Change it to check if it's touching your player character.
Hint: show image
4. If so, then change the score variable by 1
Hint: show details
Find an orange variables block called "change __ by ___" and put it in the "then" blank. Make it say "change score by 1."
Hint: show image
5. Delete the clone after changing the score
Hint: show details
Find a "control" block called "delete this clone" and put it after the orange score block.
Hint: show image
6. 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