STEP 16: Let's use a conditional inside the interval event to check if the ball has fallen and the user has lost!

  • In LOGIC from add Less Than indented once inside the interval event.
  • Change my_var to ball_off and 0 to -250. This checks if the ball has fallen through the floor!
  • In GRAPHICS from add Say inside the if-statement (indented twice!).
  • Assign the .say() to paddle and edit the string argument to "You lose!"

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)