No collisions yet btw Scroll up / up arrow to zoom in Scroll down / down arrow to zoom out Space to spawn new planets Top left number is zoom % (Theoretically realistic, but probably not)
This is a Newtonian Gravity simulator, F=(G*m1*m1)/r G is the gravitational constant, a magic number, if you will m1 & m2 are the masses of the two objects r is the distance I then do a bit more math to split the force (F) into x and y components, then apply that to the velocity. Repeat that for each object in the simulation, and you have Gravity (TM)