Project 442: Infinite Flying Game

8. Add a penalty if the hero touches an obstacle

The game should also stop if the hero touches an obstacle!
Starting point file for this challenge

Your goal

Steps

1. Go back to the hero's code and add another if-statement

You can either add this in with the other if-statement blocks, or start a new piece of code. In the example, it's going along with the other if-statement blocks that end the game. 

2. Check if the hero touches the obstacle

Grab the light blue sensing block, "touching mouse-pointer?" Put this in the "if" part of the statement. Change "mouse-pointer" to the name of your obstacle sprite. 

3. Add a "stop all" block as a result

This is a "control" block. 

4. Check to make sure this code repeats forever

Is this code in a forever loop? If not, put a forever loop around your if-statement.