See inside and read the comments to see how I created a program to replicate gravity. See my projects "Gravity Example" and "Gravity Plus Forward Movement" for more information.