I am trying to make a game where you have to collect the turtle so when you click a turtle it moves into a box. The problem with this is that when you click one of the turtles a turtle moves that you didn't click. I think that it is because I created one variable to control multiple turtles, but I don't know how to fix this. Here is my code: (btw, I was having trouble adding in the code using the 'code' button on stack overflow)
import turtle
import random
s = turtle. Screen()
s.bgcolor("lightgreen")
print("Welcome! this pond is infested with turtles! Can you catch all the turtles?")
for x in range(0,5):
t = turtle.Turtle()
c = 'yellow', 'gold', 'orange', 'red', 'magenta', 'navy', 'blue', 'purple', 'cyan', 'brown', 'black', 'gray', 'white'
t.color(random.choice(c))
t.shape("turtle")
t.penup()
t.hideturtle()
r = random.randint(-75,75)
r2 = random.randint(-75,75)
r3 = random.randint(1,10)
t.goto(r,r2)
t.showturtle()
def fxn (x, y):
t.goto(95,-122)
print("yes")
t.onclick(fxn)