Step 6: Fight the Boss 1

Goal:


We can now defeat the boss, but we need to tell the game how the player can fight him.

We have two weapons to fight the boss with, lasers and time bombs.

Let’s code what happens when the boss is hit with a laser first.

Steps:

  1. From Control, place an IF statement block.
  2. From Sensing, place a touching mouse-pointer block and set it to Red_laser.
  3. From Variables, place a change by block.
  4. Set the variable to Boss Health and the amount to -1.

Code: