STEP 6: Let's make something happen when our sprite reaches the object it's going to!

  • Click on . Drag Collision into the bottom of your program.
  • Click Run and watch what happens when your sprite collides with the hat.

Events are a special kind of code that runs only if something happens to trigger the event. Sometimes we trigger events with the keyboard or the mouse. In this case, the event will run when our sprite collides with another sprite.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("winter") sprite = codesters.Sprite("snowman") sprite.set_size(.5) sprite.pen_down() sprite.glide_to(5, -6)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)