2D Planet Gravity

Posted by baked on Game Development See other posts from Game Development or by baked
Published on 2011-12-14T14:44:51Z Indexed on 2012/12/14 23:23 UTC
Read the original article Hit count: 384

Filed under:
|

I'm trying to make a simple game where a spaceship is launched and then its path is effected by the gravity of planets.

Similar to this game: http://sciencenetlinks.com/interactives/gravity.html

I wish to know how to replicate the effect the planets have on the spaceship in this game so a spaceship can 'loop' around a planet to change direction.

I have managed to achieve some bogus results where the spaceship loops in a huge ellipse around the planet or is only slightly affected by the gravity of a planet using Vectors.

Thanks in advance.

p.s I have plenty of coding experience just none to do with game dev.

© Game Development or respective owner

Related posts about 2d

Related posts about 2d-physics