我试图在python图形中同时移动两个对象(这似乎是指John Zelle's graphics.py),然后在循环中重复移动。不过,当我试图循环它,形状消失。我该怎么解决?
def main():
win = GraphWin('Lab Four', 400, 400)
c = Circle(Point(100, 50), 40)
c.draw(win)
c.setFill('red')
s = Rectangle(Point(300, 300), Point(350, 350))
s.draw(win)
s.setFill('blue')
s.getCenter()
while not c.getCenter() == Circle(Point(400, 50), 40):
c.move(10, 0)
s.move(-10, 0)
win.getMouse
while not (win.checkMouse()):
continue
win.close()
目前没有回答
相关问题 更多 >
编程相关推荐