STEP 7: We're finally ready to create the firework particles! We'll create 10 circles for each of the three colors.

  • From drop Loop with Range indented in the first loop. It will be indented twice ········!
  • Change the range() from 5 to amount. How many times will this loop repeat?
  • From GRAPHICS, drop Circle in the loop. It will be indented three times ············.
  • Change the arguments from (0, 0, 100, "blue") to (x, y, 10, color). Run and try clicking!

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() particle_list = [] for color in color_list: pass # 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)