Step 4: Create Bomb Clone and Lower Bomb Count

Goal:


Now that we have pressed the fire button, and the game has determined that we have bombs left to fire, we need to actually fire one.

We do this by creating a new bomb clone and then the clone will take care of the rest of its code such as movement and explosions.

We also need to lower our bomb count now that we have fired one off.

Steps:

  1. From Control, place a create clone block, and change it from “myself” to “Time_Bomb”.
  2. From Variables, place a change by block.
  3. Set the variable to bombs and the amount to -1.

Code:


Click to replay