Step 12: Bomb Reload 3

Goal:


Our game can now tell how many bombs we have left, so now we need to tell it how fast it should reload our bombs.

We are going to have the game give us back 1 bomb every 5 seconds as long as we are not at our max (4).

We don’t want to immediately give ourselves more bombs or else the game will be too easy, so we are going to program in a delay, or timer, of 5 seconds.

Steps:

  1. From Control, place a wait block inside of the IF block and set it to 5.
  2. From Variables, place a change block.
  3. Set the variable to bombs and the amount to 1.

Code:


Click to replay