第 16 步:碰撞事件中的事件处理程序识别任何碰撞中的spritehit_sprite 。我们的sprite是外星人。我们将在碰撞事件中使用hit_sprite来引用我们的外星人碰撞的任何精灵。

  • 在图形中,转到并在碰撞事件中拖动Remove Sprite
  • .remove_sprite()命令中的sprite更改为hit_sprite.
  • ,在碰撞事件中拖动Say 。将字符串更改为"I got one!"

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)