Step 6: Respawn Timer

Goal:


We want to make the enemy sprite appear at different times from each other.

To code this, we will make a new enemy clone wait a random time between 1 and 1.5 before it can appear on the screen.

We want to do this because we don’t want the player to be able to just press the jump button in time without looking.

Steps:

  1. From Control, place a wait block.
  2. From Operators, place a pick random block into the wait block.
  3. Set the numbers to 1 and 1.5.

Code: