NOTE: This is collision detection, NOT physics. Physics accounts for speed, mass, and momentum, It also saves the state of all the objects and calculates changes in speed and direction of objects based on these factors.
What this program does is reverse directions on collisions. It does not account for changes in speed of the colliding objects. Also some of collisions are weird because of the frame rate. There are many instances where a ball won't indicate a hit, because it seemed as if it didn't hit becaus the framerate was too slow to capture it.
Here it is: Lol I never used this one before weee!
I might add physics later on, while I'm learning how to add audio to it... just for fun. What's really tough is just keeping this thing organized. I think I might make it so that the physics function calculates all the collisions and then, moves the balls as it sees fit, but there are still a lot of details to figure out...