Example #1
0
    public void ExecutePhysics()
    {
        if (movementController.GetVelocity().y <= 0) // If falling
        {
            stateMachine.ChangeState(playerController.fallingState);
            return;
        }
        if (playerController.HandleSlideCheck())
        {
            stateMachine.ChangeState(playerController.slidingState);
            return;
        }

        playerController.HandleAirborneMoveInput(PlayerTimings.PLAYER_AIR_MOVE_SPEED);
        HandleInputOnce(playerController.playerInputData);

        //handle falling, getting hit, and dying
    }
    public void ExecutePhysics()
    {
        if (movementController.IsAirborne() == false)                 // if grounded
        {
            stateMachine.ChangeState(playerController.standingState); // Go to standing state
            return;
        }

        if (playerController.HandleSlideCheck())
        {
            stateMachine.ChangeState(playerController.slidingState);
            return;
        }

        playerController.HandleAirborneMoveInput(PlayerTimings.PLAYER_AIR_MOVE_SPEED);
        HandleInputOnce(playerController.playerInputData);

        //handle falling, getting hit, and dying
    }
Example #3
0
    public void ExecutePhysics()
    {
        AdvancedMovement.Slide(movementController, GameConstants.WALL_SLIDE_MAX_DROP_SPEED);

        if (playerController.HandleSlideCheck()) // is sliding
        {
            if (!movementController.IsAirborne())
            {
                stateMachine.ChangeState(playerController.standingState);
            }
        }
        else // is not sliding
        {
            stateMachine.ChangeState(playerController.fallingState);
            return;
        }

        playerController.HandleAirborneMoveInput(PlayerTimings.PLAYER_AIR_MOVE_SPEED);
        HandleInputOnce(playerController.playerInputData);
    }