STEP 4: Let's create a firework every time the user clicks the stage. To do this, we'll use an event!

An event is a block of code that will only run when a certain action happens. In this case, only when you click!

  • From GRAPHICS and , drag out Disable Walls. This will stop our fireworks from bouncing!
  • From drop Click on Stage at the bottom of your program
  • Find and delete this line of code: ····sprite.glide_to(x,·y)¬ . Don't delete the other code in the event!

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

stage.set_background_color("black") amount = 10 speed = 5 color_list = ["purple", "yellow", "red"]
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)