STEP 19: Inside the collision event, use an if statement to test if lives is less than or equal to <= 0.

  • Use Text in Color to display a message in "red" at (0,0) that says "GAME OVER!" in the if statement.
  • Add a Say command to the if statement.
  • Change the string in .say() to "Your final score was ___". Use + and str() to replace the blank with the value of score.

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)