Skip to content

Instantly share code, notes, and snippets.

@ProgDan
Created June 12, 2020 11:58
Show Gist options
  • Select an option

  • Save ProgDan/444369d4c847d005767b86859a08509b to your computer and use it in GitHub Desktop.

Select an option

Save ProgDan/444369d4c847d005767b86859a08509b to your computer and use it in GitHub Desktop.
def move():
if head.direction == "up":
y = head.ycor() # coordenada y da turtle
head.sety(y + 20)
if head.direction == "down":
y = head.ycor() # coordenada y da turtle
head.sety(y - 20)
if head.direction == "right":
x = head.xcor() # coordenada x da turtle
head.setx(x + 20)
if head.direction == "left":
x = head.xcor() # coordenada x da turtle
head.setx(x - 20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment