第15步:当 car 与特定精灵碰撞时,我们要能够更改 scorelives 的值。

  • Collision with Shape 拖动到程序底部,并在事件处理器中将事件分配给 car
  • Global Variable 拖动到事件顶部 if 语句上方的位置,并将变量名称更改为 score
  • 将另一个 Global Variable 拖动到分数代码行的下一行。将变量名称更改为 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
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)