STEP 13: Collision Events cause a set of commands to run when an object touches (collides with) another object.

  • Go to and drag Collision with Other Sprite to the bottom of your program.

  • Change the name at the front of the the event handler to spaceship.

INSIDE the collision event, sprite refers to the sprite assigned in the event handler. In this example, spaceship.

INSIDE the collision event hit_sprite refers to any object the sprite collides with. In this example, astro and ufo.

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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)