I have to write a program in Python that creates two circles colliding to each other and to the sides of the window. Here is what I have so far, but the problem is that they don't collide and they don't bump against the walls.
Please tell me what i'm doing wrong or if i'm missing something. Thank you
from time import *
from graphics import *
def getCircle():
windowWidth = 500
windowHeight = 500
win = GraphWin('Animation', windowWidth, windowHeight)
center = win.getMouse()
radius = windowWidth/10
shape = Circle(center, radius)
shape.setFill('green')
shape.draw(win)
shape.move(dx = 1,dy = 1)
while win.checkMouse()==None:
sleep(0.04)
shape.move(dx = 1,dy = 1)
center = win.getMouse()
radius = windowWidth/10
shape = Circle(center,radius)
shape.setFill('red')
shape.draw(win)
shape.move(dx = 2, dy = 2)
while win.checkMouse()==None:
sleep(0.04)
shape.move(dx = 2,dy =2)
(c1.getX(), c1.getY())
(c2.getX(), c2.getY())
win.getMouse()
win.close()
getCircle()