在这个程序中,碰撞应该导致 star 消失,spaceship 返回到 (0, 0)。

  • 点击 运行 并使用方向键来控制 spaceship。查看控制台,看看有什么问题。
  • 调试程序,使精灵在碰撞时执行正确的操作。

在碰撞事件中,sprite 是在事件处理器(spaceship)之前的精灵名称。

hit_sprite 是控制台上所有其他精灵 (star1star2)。

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)