STEP 14: Let's change the collision event so that different things happen depending on what the astronaut hits!

This collision event checks what the spaceship has hit! If the image label of the hit_sprite is "astronaut1", this if-block will run. We'll also write a different if-block that will run if the spaceship hits a "ufo" instead!

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)