I am trying to make the game Asteroids. My issue I have right now, is if you press the UP Arrow key, it will move the "ship" 10 pixels up. And if you hit the LEFT Arrow key, it will turn the "ship" 5 degrees to the left, the issue I have comes into play when you turn left, or right. And then try to move up. It won't move into the turned direction. It will just move the turned "ship" 10 degrees in the Y direction.
What I am thinking of doing is having a variable called direction, think of this variable as a circle with 360 degrees. What I am trying to do is everytime I hit the Left Arrow, it will subtract 5 from direction, which started at 0 and goes backwards from 360 and thus set it to 355. I would then divide 355 by 10 and get 35.5. Then I would divide 10 by 35.5 and get .355. I would then subtract .355 from 10 (moving up in the Y). And subtract it from 0 (moving left in the X). So I would be moving 9.645 up in the Y and moving 0.355 left in the X.
The issue I'm having is the "ship" in Asteroids I have is a Graphics.FillPie, which needs Ints to use as the Start Angle and Sweep angle, However as you can see I would have to be working with doubles or floats. I'm pretty sure I'm overcomplicating this and am pretty sure there is something 100 times simpler, I'm thinking something along the lines of Bresenham's Line Algorithm. If anyone could help by suggesting something easier or a fix to my problem, it would be much appreciated. Thanks in advance.