STEP 18: Let's set up the penalty for hitting rocks or garbage!

  • Inside the event, use an if or statement to test if name is "rock" or if name is "garbage".
  • Use Remove Sprite to remove the hit_sprite from the stage.
  • Use Subtract Value to subtract 1 from the lives counter.
  • Use Update Display to update the lives_display with the new value of lives.

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)