This is a physics engine that I copied. Click space to spawn more blocks to mess around with. It is laggy FYI
Thanks to @DK-Tutorial for pretty much all the code.