Step 5: Defeat Boss Code

Goal:


We now need a way to tell the game that we have beaten the boss. We will do this by having the game check the boss’ current health and if his health is below 1 then he needs to be destroyed.

For now we will just delete the clone, but in the next lesson we will add to what happens when we beat the boss.

Steps:

  1. From Control, place an IF statement block.
  2. From Operators, place a <(Less Than) block, and set the right side to 1.
  3. From Variables, place a round Boss Health block in the left side of the <(Less Than) block.
  4. From Control, place a delete this clone block inside the IF statement block.

Code: