STEP 16: First we'll test if the hit_sprite the car collided with was the lawn, using the lawn's color.

  • Delete the second if statement in the collision event, and both say commands in the event.
  • Rename variable storing get_color() to color.
  • Change the first if statement in the event to test if color is equal to "lightgreen".
  • If the color is "lightgreen", use Go To to send the sprite back to its starting point, (0, -200).

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)