第15步:当 car 与特定精灵碰撞时,我们要能够更改 score 和 lives 的值。
- 将 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.