STEP 13: When the dino hits a meteor, we also want to reset the meteor. We'll start by moving it to a random corner.

  • Inside the event, use Random Choice to create a variable named x with a list of ([-230, 230]).
  • Use another Random Choice command to create a variable named y with a list of ([-230, 230]).
  • Use Go To to tell the hit_sprite to go to the location (x,y).

Now each meteor will have an x-coordinate of either -230 or 230 and a y-coordinate of either -230 or 230.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)