Simple Bouncing Ball Simulation

Here we have a simple ball 2d physics sim. There is a "black hole" in the centre, and each ball is generated with a random mass, and the radius is proportional to the square root of the mass. and you can change various parameters at the bottom. The collision detection is very ropey and the system is not well optimised.

Delta T 10
FPS 60
Gravity -9.81
Elasticity 0.9
Number of Balls 5
Black Hole Power 0.5

Parameter Help

Delta T Time in milliseconds between simulations steps
FPS Frames drawn per second
Gravity Downwards Acceleration of gravity in 100s of pixels per second squared
Elasticity Factor by which velocity is multiplied by when a ball colides with a wall
Number of Balls Number of balls simulated (note you must reset the simulation to update this parameter)
Black Hole Power Factor of the strength of the force applied by the black hole