rendered paste body// assume mMomentum is a field in the class
Keyboard keyboard = InputManager.Keyboard;
if(keyboard.KeyDown(Keys.Up))
{
mMomentum += TimeManager.SecondDifference;
}
if(keyboard.KeyDown(Keys.Down))
{
mMomentum -= TimeManager.SecondDifference;
}
RotationZVelocity = 0;
if(keyboard.KeyDown(Keys.Left))
{
RotationZVelocity = 1;
}
else if(keyboard.KeyDown(Keys.Right))
{
RotationZVelocity = -1;
}
// We know the momentum and we know the angle:
XVelocity = (float)Math.Cos(RotationZ) * mMomentum;
YVelocity = (float)Math.Sin(RotationZ) * mMomentum;