Step 11: Game Restart

Goal:


We need a way to restart our game whenever we want. The best way to do that is to sense if you touch the image of Pikachu with your finger.

This will re-activate the pokeball and give pikachu full health again.

Steps:

  1. From Pikachu, place a Touch block.
  2. From Control, place a IF/THEN block inside of the Touched block.
  3. From Logic, attach a NOT block to the IF portion of the IF/THEN block.
  4. From Pokeball, attach an Enabled block to the NOT block.
  5. From Pokeball, place a set Pokeball.Enabled block inside of the THEN portion of the IF/THEN block.
  6. From Logic, attach a true block to the set Pokeball.Enabled block.
  7. From Variables, place a set global health block.
  8. From Math, place a 0(zero) block and set it to 100.

Code: