STEP 5: Each firework will have many particles. To keep track of them, we can store them in another list!

Each firework needs its own list. We'll create a new list each time we click. For now, that list can be empty!

  • In LOGIC from drag out Empty List. Change the list's name from my_list to particle_list.
  • Make sure the code for the empty list is indented one time ···· so that it is inside the click event!

Indentation is one tab or four spaces. It groups code inside events, loops, conditionals, and functions.

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"] stage.disable_all_walls() def click(): x = stage.click_x() y = stage.click_y() # add other actions... stage.event_click(click)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)