Step 3: Easy Target Hit Reset

Goal:


When the game is restarted we want the Easy Target to respawn in a different spot every time.

We can do this in our code by choosing a random number between 25 and 75 and then move the target to the right that many times before it reappears.

Steps:

  1. Stay on the “Easy Target” sprite.
  2. From Control, place a repeat block.
  3. From Operators, find a pick random 1 to 10 block and place it inside the repeat block.
  4. Change the numbers to 25 and 75.
  5. From Motion, place a change x by block and set the number to 5.
  6. From Motion, find a set y to block and place it outside of the repeat block and set the number to -15.
  7. From Looks, place a next costume block.
  8. From Looks, place a show block.

Code:


Click to replay