STEP 14: Now we'll set it up so that the player loses points when they click on a clown fish.

  • Use if to test if the value of sprite_img is "fish1". Drop it inside the click event, so it has a ····.
  • Inside the if statement, use Subtract Value to subtract 1 from the value of score.
  • Inside the event (but outside the if statement), use Update Display to update the score in the score_board 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)