Max Speed configuration
Anyhow, the way I usually think about the speed of things is by comparing them to a software blitter for an image. In this case I suspect that the time it takes for your ship to be drawn onscreen is a lot longer than for this little calculation - though there's still room here for improvement.
Good luck
Starfall
Sin and cosine lookup will help the most, try to minimize the size of the table so it caches better (like store only 90 degrees of the table, which has all the values you need.)
But don't go crazy on this yet, just keep it simple for now, and then profile later to see if this is an area taking a huge chunk out of performance (and I'm guessing it probably won't be.)
if(Player.x_vol*Player.x_vol+Player.y_vol*Player.y_vol < Player.Max_Speed*Player.Max_Speed)
{
Player.x_vol += ((float)sin((Player.Direction-1)*10 * 3.14159/180)*Player.Acceleration);
Player.y_vol -= ((float)cos((Player.Direction-1)*10 * 3.14159/180)*Player.Acceleration);
}
There are two problems. First of all, they can go slightly over the max speed. However, I am not really worried about that. Second, every time they hold down the up key it has to use multiplication. Will this reduce the speed on slower machines significantly? If so, what is another alternative? Thanks.