Three Bouncing Balls

This program uses Python's processing package to draw a canavs, draw objects and create a continuously running loop. Dictionaries are also utilized to store the values of each of the three balls, which includes their radii, coordinates and changes in x and y values per frame. Each frame; or iteration of the loop, the balls' coordinates are updated and everything is redrawn to make them move around the canvas. In addition, the coordinates of each ball's left, right, bottom and top edges are used to create parameters for a collision box. When these are used to perform collision checks against the coordinate dimensions of the canvas edges via inequalities and condition statements, the balls are made to bounce around.

Run Program