I noticed the divide by zero was happening when the screen would go fully black. Thus the normalizing causing the issue, due to retro being zero. How exactly does the above cause the rocket to be more responsive though? Unless I'm implementing your math wrong. I find when I begin to turn I lose most of my velocity exceptionally quick. But that was with a retroforce of 5 etc, where as 1 feels a lot nicer, except I'm still drifting a lot like before. Either the values I'm using are way off, or I'm not implementing it correctly to be able to do a smooth 180 turn etc, and still keep majority of my velocity.
float rocket_boost = 0.0f;
if (Global.Instance.IsDown(Keys.W))
rocket_boost = 2000.0f;
Vector2 force = direction * rocket_boost;
mass = 10.0f;
Vector2 acceleration = force / mass;
velocity += acceleration * DT;
Vector2 desired = direction * velocity.Length();
float retroForce = 5.0f;
Vector2 retro = desired - velocity;
retro.Normalize();
float retroLength = retro.LengthSquared();
if (retroLength > 0)
{
retro /= (float)Math.Sqrt(retroLength);
retro *= retroForce;
velocity += retro;
}
position += velocity * DT;
Thanks so much for the help you're providing though. I can't believe how much more there is to moving objects than I've previously done. When ever I've implemented movement before, it has been nothing remotely detailed in comparison.