STEP 12: Let's have the cars on the other roads run the opposite way.

  • Drag another if or command inside the function (but outside of the if statement).
  • Set up this if statement to test if rand_y is -50 or 150.
  • Drag Sprite at Position inside the new if statement and change its name to car.
  • Change car's image name to car_img. Make its x-coordinate 400, and its y_coordinate rand_y.

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)