STEP 4: Let's also use a random integer as a y-coordinate and then set up a sprite that will appear at that location!

  • From , drag another Random Integer inside the loop.
  • Name the random integer rand_y and give it a range of (-200, 200).
  • Go to and drag Sprite at Position inside the loop. Rename it astro.

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)