第18步:让我们设置撞到岩石或垃圾的惩罚!
- 在事件内部,使用 if or 语句来测试 name 是 "rock" 还是 "garbage"。
- 使用 Remove Sprite 将 hit_sprite 从控制台上移除。
- 使用 Subtract Value 从 lives 计数器中减去 1 。
- 使用 Update Display 将新的 lives 值更新到 lives_display 中。
To navigate the page using the TAB key, first press ESC to exit the code editor.