Step 9: Damage

Goal:


With our pokeball reset, let’s tell it how much damage to do to the pikachu.

We are also going to change our label so that it displays how much health we still have.

Steps:

  1. From Variables, place an initialize global somewhere on the screen and call it Damage.
  2. From Math, attach a 0(zero) block to the end of the initialize global block and set it to 5.
  3. From Variables, place a set global health block.
  4. From Math, attach a -(minus) block to the end of the set global health block.
  5. From Variables, place a get health block in the left side of the -(minus) block.
  6. From Variables, place a get Damage block in the right side of the -(minus) block.
  7. From Health, place a set Health.text block.
  8. From Variables, attach a get health block to the end of the Health.text block.

Code: