【问题标题】:Python - How to make turtle go to (x,y) position without having it move across the screen?Python - 如何让乌龟移动到(x,y)位置而不让它在屏幕上移动?
【发布时间】:2018-04-25 16:58:56
【问题描述】:

我想知道如何让Turtle 转到 (x, y) 坐标而不让它在屏幕上移动。我尝试了.goto().setposition() 方法,但它们都使乌龟在屏幕上移动。我该怎么做?

【问题讨论】:

标签: python coordinates turtle-graphics


【解决方案1】:

你可以用pen up,然后设置turtle不可见,然后使用goto将turtle移动到你的位置。

turtle.up()
turtle.ht()
turtle.goto(x, y)

# reshow the turtle
turtle.st()
turtle.down()

【讨论】:

    猜你喜欢
    • 2022-10-15
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 2013-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多