""" ChapterAnimation/circleMove0.py move a circle """ from graphics import * def main(): win = GraphWin( "Demo: rolling car") win.setBackground('#0000FF') #blue p1 = Point(10,70) #starting point radius = 20 myc = Circle( p1, radius) #make object myc.setFill( '#ffff00' ) #put color myc.draw( win ) #draw #draw object while True: myc.move(5, 0) time.sleep(.05) if myc.getCenter().getX() > win.getWidth() - radius: # check distance break win.close() main()