We don't want to put garbage into the recycling!

  • Inside the event, use an if statement to test if litter is in the garbage list.
  • Inside the new if statement, use Remove Sprite to remove the hit_sprite.
  • Use Subtract Value to take away 1 point from recycle_xp each time the sprite picks up garbage.
  • Use Update Display to update the recycle_xp in the collected_display.

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)