Animations and Interactive Programming
Interactive Programming
Move the turtle to the position where the user clicks:
import turtle
turtle.setup(500, 500)
screen = turtle.Screen()
turtle.title("Turtle Keys")
turtle.pensize(3)
screen.onscreenclick(turtle.goto)
turtle.done()
Click on the turtle screen and check if your turtle is moving to that location.
screen.onscreenclick
method requires the name of a method which has two parameters corresponding to x
and y
coordinates.