So I was going to have a go at making a little 2D space action combat game, but have unfortunately fallen at the first hurdle and cant seem to get the players ship going in the right direction.
The ship has an X and Y, an X Velocity value, a Y Velocity and an angle, all floats.
When the up key is pressed, a force is added to the X and Y velocities depending on the ships rotation.
shipVX += 0.05 * (float) Math.cos(shipAngle);
shipVY += 0.05 * (float) Math.sin(shipAngle);
However, the ships angle and the directions of the force don't seem to match up in any way. I've tried rejigging that bit of code, but cant get anything that makes any sense.
Its probably just my maths that's at fault, haven't had to do any physics since college, anyway, any thoughts and suggestions would be greatly appreciated.
Full code here: http://pastebin.java-gaming.org/053379f186d