STEP 17: Now we need to create actions that happen when our hero collides with other sprites!

  • Go to and drag Collision with Other Sprite into your program.
  • Assign the event to hero by changing the name in front of the event handler to hero.
  • Drag in Global Variable to be the first line inside the collision event, above the if statement.
  • Change the variable to score. Now we can change the value of score inside the collision event.

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)