第 13 步:我们将使用碰撞事件来检测飞船何时接触到 UFO 或宇航员!

  • 并将Collision with Other Sprite拖到程序的底部。

  • 将事件处理程序前面的名称更改为spaceship

在碰撞事件中,精灵指的是在事件处理程序中分配的精灵。在这个节目中, spaceship

在碰撞事件中, hit_sprite指的是精灵碰撞的任何对象。在这个程序中, astroufo

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)