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

Steps

1. Add another "when green flag clicked" on the player

This is a yellow "events" block. Add this to the player sprite.

2. Check if it's touching the obstacle

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. 

3. If so, then add a "stop all" as a result

Grab a "stop all" block from the "control" section and drop it in the "then" blank. 

4. Repeat the code forever

Put a forever loop from the "control" section around the entire if-statement.