I'm having trouble making all of the turtles draw a circle all together because I'm using for loops to make those turtles orbit one by one,
from turtle import Turtle, Screen
import random
w = Screen()
w.bgcolor('#222')
def color_generator():
symbols = [str(n) for n in range(5, 10)] + ['a', 'b', 'c', 'd', 'e', 'f']
pick = [random.choice(symbols) for _ in range(3)]
color = ''.join(pick)
return f'#{color}'
class Particle(Turtle):
def __init__(self):
super().__init__()
self.shape('turtle')
self.penup()
self.create_particle()
def create_particle(self):
self.color(color_generator())
self.goto(random.randint(-350, 350), random.randint(-350, 350))
self.seth(random.randint(0, 360))
def orbit(self):
self.speed('fast')
self.pendown()
for _ in range(25):
self.forward(10)
self.right(15)
for _ in range(5):
t = Particle()
t.orbit()
w.exitonclick()
how can I make all of them orbit all together?
here's what it's doing: