Jump to content

How do you make your turtle look to the right of the screen? (python)

DietzDiet
 Share

Go to solution Solved by C2dan88,

Use setheading?

So I'm trying to make a etch-a-sketch on turtle python and I am having trouble when I try to make the turtle face right of the screen because I dont know which way the player will face when they clear the screen.

<

from turtle import Turtle, Screen

Ched = Turtle()

ScreamButTheAisAeAndTheMisAN = Screen()

def forward():
    Ched.forward(10)
def back():
    Ched.forward(-10)

def right():
    Ched.rt(10)

def left():
    Ched.lt(10)

def clear_screen():
    Ched.penup()
    Ched.setpos(0, 0)
    

ScreamButTheAisAeAndTheMisAN.listen()

ScreamButTheAisAeAndTheMisAN.onkey(key="w", fun=forward)
ScreamButTheAisAeAndTheMisAN.onkey(key="d", fun=right)
ScreamButTheAisAeAndTheMisAN.onkey(key="s", fun=back)
ScreamButTheAisAeAndTheMisAN.onkey(key="a", fun=left)
ScreamButTheAisAeAndTheMisAN.onkey(key="c", fun=clear_screen)

ScreamButTheAisAeAndTheMisAN.exitonclick()>

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×