by skydereign » Sun Mar 13, 2011 12:39 am
Try this. I had the ship decelerate when you want to go backwards. When it reaches a certain speed, it sets a variable telling the ship that it is moving backwards and begins to accelerate (but moving backwards). The variable backwardsState also tells the animation that it should rotate the animation 180 degrees when you are moving backwards. The only other thing is that the mouse button down events for the buttons also have a bit of code. It essentially says if the ship was moving backwards, flip it back. Do note that if you start moving forward again, you will continue moving at the same speed you were moving backward, as I didn't implement the slow down, speed up in the other cases. Lastly, in player's draw I put a switch statement instead of a lot of those ifs.
- Attachments
-
- UA.ged
- (12.92 KiB) Downloaded 144 times