STEP 9: We also need the program to put each object in a random lane.

  • Drag Random Choice inside the interval event and name it rand_x.
  • Replace the list variable in random.choice() with the list [-100, 0, 100].

Now the program will pick one value from the list of possible x-coordinates each time the interval runs.

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)