第19步:在碰撞事件中,使用 if 语句来测试 lives 是否小于或等于 <= 0

  • 在 if 语句内,使用 Text in Color (0,0) 展示一条 "red""GAME OVER!"
  • 在 if 语句中添加一个 Say 指令。
  • .say() 中的字符串更改为 "Your final score was ___"。使用 +str() 将空白替换为 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
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)