STEP 10: Let's make our UFOs move along the x-axis at random speeds.

  • Go to and drag out Random Integer. Drop it inside the for loop.
  • Change its name to rand_speed.
  • Change the range so that it creates a random number from (-2, 2).
  • Go to and use Set x Speed to set the ufo's speed to rand_speed.

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)