Hi,
I'm having some issues with this section of my code, it has errors in Terminal and the feedback isn't very specific. Thanks!!
I'm having some issues with this section of my code, it has errors in Terminal and the feedback isn't very specific. Thanks!!
Code:
import turtle
import time
variable1=turtle
# turtle object
#img_turtle = Turtle.fish()
#turtle.register_shape('turtle.gif')
#img_turtle.shape('turtle.gif')
speed = 2
def travel():
turtle.penup()
turtle.forward(speed)
variable1.ontimer(travel, 10)
variable1.onkey(lambda: turtle.setheading(90), 'Up')
variable1.onkey(lambda: turtle.setheading(180), 'Left')
variable1.onkey(lambda: turtle.setheading(0), 'Right')
variable1.onkey(lambda: turtle.setheading(270), 'Down')
variable1.listen()
travel()
variable1.mainloop()