I’m currently tinkering with a little game where the players ship is moved about in much the same way as in Asteroids - rotate left/right and thrust. The problem I’m having is how to apply the thrust to the players ship.
I found an old post about a very similar thing which had the following answer from Brent
- At any time when the boost/thrust button is pressed down, gather the angle (rotation) of the ship. Using basic vector math, convert this angle to X/Y vector values, and then apply that force to the ship (from behind it actually), focusing the force on the body’s center point. (http://docs.coronalabs.com/api/type/Body/applyForce.html)
Being a complete loser when it comes to anything maths related, could some kind soul please show me how I would go about working out the vectors to apply the thrust.
Many thanks