Tag Info

Hot answers tagged

2

You probably have object leaks. Objects that are still referenced somewhere in an array or list, creating more and more objects for the garbage collector to process as the game advances. Or more and more AI objects that are off-screen but still active and processing on every frames.


1

I suggest moving the target slowly rather than the angle. Try this: Vector2 Target; // Interp is a value between 0 and 1. When 0, the target never moves. // When 1, the target moves instantaneously. Intermediate values cause the target // to move at different rates. void UpdateTarget(float interp) { Target = interp * Mouse.Position + (1 - interp) * ...


1

I think any linear function would be fine for this. You can keep two variables one for your spaceship's current angle spaceshipAngle = Math.PI*k, and one for the current angle that the user inputs with his cursor cursorAngle = Math.PI*p. And what you do is if (Math.Abs(Math.PI*k, Math.PI*p) < Math.PI) { if (Math.PI*k < Math.PI*p) k += ...



Only top voted, non community-wiki answers of a minimum length are eligible