If you take a look at the actual gravity equation [g = -G(M/r^2)] you'll notice that the force decreases as the square of the distance. So once you determine the masses of your planets and determine the value of G to suit your simulation (you can use the real value if you want [6.673x10^-11], but to get a large effect you would have to use really large masses... for 9.8 m/s^2 close to one of the planets you would have to use the real value for the mass of the Earth: ~6x10^24 kilograms!), use the given equation and the rest will take care of itself. Calculate the vector pull on object one from planet one, calculate the vector pull on object one from planet two, and at the right distance and location, the vectors will cancel...