STEP 9: Before looping through the particles, we need a variable to keep track of the angle of each particle.

  • From add Integer Variable indented only once under the loops and inside the event.
  • Change the variable name from my_var to angle and change the value from 25 to 0.

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: for counter in range(amount): sprite = codesters.Circle(x, y, 10, color) particle_list.append(sprite) # 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)