Python turtle set start position

后端 未结 5 2191
长情又很酷
长情又很酷 2020-12-20 03:36

How do I set the startpos (topleft of my turtle square) when starting my code?

And I don\'t mean that it starts from the middle and then goes to that position.

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 03:45

    At the beginning of the code, after defining the turtle, you can do:

    tom.penup()
    tom.goto(x coordinate that you want, y coordinate that you want)
    tom.pendown()
    

    This will make the turtle invisible.
    Then go to the position given by x and y, it makes the turtles trail visible again.

提交回复
热议问题