I am trying to move the object around the screen with the arrow keys. I have left and right how I want them, but when I am trying to go up it doesn't work how I want.
I tried to use player.left(90)
then move forward but then I have to use the right arrow key to move up. I would prefer to not even have the object rotate 90deg
I just want to easily move the object around the window.
python
import turtle
window = turtle.Screen()
window.bgcolor('black')
player = turtle.Turtle()
player.shape('square')
player.color('white')
player.penup()
def move_left():
player.color('light green')
player.backward(10)
def move_right():
player.color('light green')
player.forward(10)
def move_up():
player.color('light green')
player.left(90)
player.forward(10)
window.onkeypress(move_left, "Left")
window.onkeypress(move_right, "Right")
window.onkeypress(move_up, "Up")
window.listen()
turtle.done()