Some games require handling gravity from multiple variable sources. In this recipe, we'll handle this and create a simple miniature solar system to demonstrate it using
ThrusterControl from the Building a rocket engine recipe. To (greatly) simplify the relation between the planets, they won't affect each other with their gravity, but only the ship. It will also be made in a 2D-asteroids-like fashion, although the gravity would still apply for a 3D game.
We'll add some basic controls to rotate the ship to the left and right, and you can use the thruster to make the ship move forward.
ThrusterControl, we'll create two more small classes and an application class that joins everything together. ...