SmashBros.Controllers.CharacterController.Navigation C# (CSharp) Method

Navigation() private method

private Navigation ( float directionX, float directionY, int playerIndex, bool newX, bool newY ) : void
directionX float
directionY float
playerIndex int
newX bool
newY bool
return void
        private void Navigation(float directionX, float directionY, int playerIndex, bool newX, bool newY)
        {
            if (!model.attackMode && model.resetTimeLeft <= 0)
            {
                if (directionX !=0 && directionX * view.VelocityX >= 0) model.faceRight = directionX > 0;

                if (directionY < -0.95 && newYdir && model.jumpsLeft > 1 && view.VelocityY > -model.JumpStartVelocity + 4)
                {
                    model.setState(CharacterState.jumping);
                    view.VelocityY = -model.JumpStartVelocity;
                    if (directionX * view.VelocityX <= 0) view.VelocityX = MathHelper.Clamp(view.VelocityX + directionX * 4, directionX<0? -5 : -2, directionX<0? 2 : 5);
                    model.jumpsLeft--;
                }
                if (directionY > 0.9)
                {
                    view.BoundBox.CollidesWith = Category.All & ~Category.Cat10 & ~Category.Cat11;
                    if (model.onSoftBox)
                    {
                        model.setState(CharacterState.falling);
                        model.onSoftBox = false;
                    }
                }
                else view.BoundBox.CollidesWith = Category.All & ~Category.Cat11;
            }

            newXdir = newX;
            newYdir = newY;
            navigation = new Vector2(directionX, directionY);
        }