Step 7: Ground Touch Reset

Goal:


Now it’s time to code for what happens when Iron man touches the ground.

When the player lets Iron man touch the color of the ground, the game needs to reset.

Steps:

  1. Still on the Iron Man sprite, From Events, place a When green flag clicked block to an empty space.
  2. From Control, add a forever loop, then put an IF statement inside it.
  3. From Sensing, add a touching color block inside the condition of the IF statement.
  4. Click the color bubble and select the button with a picture of a dropper. Use the dropper tool to select the exact color by clicking on the actual ground in your game window.
  5. Lastly, From Events, place a broadcast reset_game block inside of the IF statement.

Code: