public void Move(GameTime gameTime)
        {
            if (Health <= 0)
            {
                return;
            }
            var timeElapsed = Math.Min(gameTime.ElapsedGameTime.Milliseconds / 1000f, 0.2f);
            var movement    = Velocity * timeElapsed;

            mLastVelocities[mCurrentLastVelocitiesIndex] = Velocity;
            mCurrentLastVelocitiesIndex++;
            mCurrentLastVelocitiesIndex %= mLastVelocities.Length;
            var averageVelocity = mLastVelocities.Aggregate(Vector2.Zero, (current, velocity) => current + velocity);

            Position += movement;
            if (CurrentQuadTree == null)
            {
                Position -= movement;
            }
            else
            {
                Position += QuadTree.ClampPosition(this);
                CurrentQuadTree.UpdateGameObjectPosition(this);
            }

            if (Math.Abs(averageVelocity.Y) > 2 * Math.Abs(averageVelocity.X) && !mOnlyLeftRightDirection)
            {
                if (averageVelocity.Y > 0)
                {
                    mDirection = (int)Directions.Down;
                }
                else
                {
                    mDirection = (int)Directions.Up;
                }
            }
            else if (2 * Math.Abs(averageVelocity.Y) < Math.Abs(averageVelocity.X))
            {
                if (averageVelocity.X > 0)
                {
                    mDirection = (int)Directions.Right;
                }
                else
                {
                    mDirection = (int)Directions.Left;
                }
            }
            else
            {
                if (mDirection == (int)Directions.Down && averageVelocity.Y < 0 ||
                    mDirection == (int)Directions.Up && averageVelocity.Y > 0 ||
                    mDirection == (int)Directions.Right && averageVelocity.X < 0 ||
                    mDirection == (int)Directions.Left && averageVelocity.X > 0)
                {
                    mDirection = (int)GetDirection(averageVelocity);
                }
            }
        }
 protected BMovableGameObject(Texture2D texture, float positionX, float positionY, float textureOffsetX, float textureOffsetY, float collisionBoxSizeX = 0.7f, float collisionBoxSizeY = 0.7f)
     : base(texture, positionX, positionY, textureOffsetX, textureOffsetY, collisionBoxSizeX, collisionBoxSizeY)
 {
     InputManager.AnyActionEvent += MoveToTarget;
     mSteering       = new SteeringManager(this);
     mBloodAnimation = AnimationManager.GetAnimation(AnimationManager.Blood, this);
     mBloodAnimation.AnimationFinished = true;
     mBlood = TextureManager.GetTexture("blood", 32, 32, 0);
     InputManager.AnyActionEvent += StopMovement;
     Mass      = 1;
     Position += QuadTree.ClampPosition(this);
 }