#15750 - MumblyJoe - Thu Jan 29, 2004 2:36 am
Ok, I am working on a game that uses the lunar lander style controls for a ship, so say for example the left and right keys rotate the ship left or right and the up key fires a booster and makes the ship go faster in the direction it is facing, if there are no boosters then turning the ship doesnt change the direction or speed the ship is moving. I use a speedx and speedy variables (signed for up/down whatever) to say how the ship moves in the next frame.
My question is, if the booster is fired and I know what angle the ship is rotated to and facing, how do I calculate how much the x and y change? So if the ship is on say a 10 degree angle, mostly the speedx gains and the speedy changes less (naturally if the ship turns around to face to way it is coming from and fires the boosters it should decelerate, but thats a part of the math I would imagine anyway...).
Any ideas?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
My question is, if the booster is fired and I know what angle the ship is rotated to and facing, how do I calculate how much the x and y change? So if the ship is on say a 10 degree angle, mostly the speedx gains and the speedy changes less (naturally if the ship turns around to face to way it is coming from and fires the boosters it should decelerate, but thats a part of the math I would imagine anyway...).
Any ideas?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!