its center reaches the low and high and coordinates the animation stops when the mouse is clickedand the last mouse click is returned ''delay pt none #new while pt =none#new shape move(dxdycenter shape getcenter( center getx( center gety(isinside true #new if xhighdx -dx isinside false #new if yhighdy -dy isinside false #new time sleep(delayif isinsidenew don' mess with dxdy when outside pt win checkmouse(#new return pt #new def moveinbox(shapestopheightxlowxhighylowyhighwin)#new '''shape bounces in win so its center stays within the low and high and coordinatesand changes direction based on mouse clicksterminating when there is click above stopheight ''scale pt shape getcenter(starts motionless while pt gety(stopheight(dxdygetshift(shape getcenter()ptpt bounceinbox(shapedx*scaledy*scalexlowxhighylowyhighwindef makedisk(centerradiuswin)'''return red disk that is drawn in win with given center and radius ''disk circle(centerradiusdisk setoutline("red"disk setfill("red"disk draw(winreturn disk def getshift(point point )'''returns tuple (dxdywhich is the shift from point to point ''dx point getx(point getx(dy point gety(point gety(return (dxdydef bounceball()'''make ball bounce around the screenand react to mouse clicks ''win graphwin('ball bounce ' win yup(#new to mark and label the area where click stops the program lineheight win getheight( textheight win getheight( more on flow of control