How to use turtle.onscreenclick?
I am creating a game where the player clicks on a turtle screen, the turtle then goes to that point and stamps an impression of itself. Anyone know how to use turtle.onscreenclick?
I am creating a game where the player clicks on a turtle screen, the turtle then goes to that point and stamps an impression of itself. Anyone know how to use turtle.onscreenclick?
Here is an example repl:
https://repl.it/@mwilki7/turtle-testing
The first parameter of onscreenclick() is the name of a function.
onscreenclick() will call this function later, and pass to it the x,y coordinates of your mouse click. So make sure that the function you give it is defined with x,y parameters.
@mwilki7 It gives error:
"Turtle" has no attribute "Screen"
@AlexanderTarn
try it or refresh page once more, i was copy pasting some stuff
@mwilki7 no this is on my program.
@AlexanderTarn
try turtle.Screen()
@mwilki7 THANK YOU