public void DrawDebugText() //TODO move into debugdrawer? { if (Flags.ShowDebuggingText) { _screenManager.SpriteBatch.Begin(); Functions_DebugWriter.Draw(); _screenManager.SpriteBatch.End(); } }
private static void ApplyInertia(MovementComponent movement, GameTime gameTime) { if (movement.RootType == EntityType.Hero) { Functions_DebugWriter.WriteLine(movement.Acceleration.Cartesian.ToString()); } if (movement.Speed.Polar.Length > 0 && (movement.FrictionWhileAccelerating || movement.Acceleration.Cartesian.Equals(Vector2.Zero) || movement.Speed.Polar.Length > movement.MaxSpeed)) { if (movement.Speed.Polar.Length - movement.Friction * (float)gameTime.ElapsedGameTime.TotalSeconds < 0) { movement.Speed.ChangePolarLength(0); } else { movement.Speed.ChangePolarLength(movement.Speed.Polar.Length - (movement.Friction * ((float)gameTime.ElapsedGameTime.TotalSeconds))); } } }