STEP 8: Why are we only seeing one circle per click? And why only one color?

Believe it or not, each click is making 30 circles! We only see one circle because they are all on top of each other.

  • In LOGIC from add Append to the loop (indented three times ············)
  • Change my_list to particle_list and my_var to sprite. This adds each circle to the particle list!

Later, we will loop through particle_list to make each circle move by giving it an x and y speed!

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) # 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)