【发布时间】:2012-05-17 03:58:37
【问题描述】:
如何让 4 只不同的海龟同时移动?另外,如何为Turtle.shape方法制作人形?我知道有一个名为 register_shape 的 Screen 方法,但我找不到任何关于它的文档。
def turtles(self, base):
self.t4.goto(self.tFirst)
self.t1.goto(self.tSecond)
self.t2.goto(self.tThird)
self.t3.goto(self.tHome)
if base >= 2:
self.t4.goto(self.tSecond)
self.t1.goto(self.tThird)
self.t2.goto(self.tHome)
if base >= 3:
self.t4.goto(self.tThird)
self.t1.goto(self.tHome)
if base == 4:
self.t4.goto(self.tHome)
tFirst、tSecond 和 tThird 是位置,t1、t2、t3、t4 是海龟。我希望所有的海龟齐声移动。
【问题讨论】: