예제 #1
0
    private void Patrol()
    {
        _movement.ClearHorizontalMovement();
        _animation = string.Empty;

        ChangeDirections();
        MoveInDirection();
    }
예제 #2
0
    private void StrikeUnguardedArea()
    {
        if (!_sense.DetectedPlayer)
        {
            return;
        }

        bool shouldCrouch = !_sense.PlayerState.isCrouching;

        if (DebugMode)
        {
            Debug.Log((shouldCrouch ? "Crouching" : "Standing") + " to strike the player where they're not guarding!");
        }

        _movement.ClearHorizontalMovement();
        PerformAttack(shouldCrouch);
    }
예제 #3
0
    private void PrepMovementFrame()
    {
        _movement.ClearHorizontalMovement();
        _isMovingHorizontally = false;

        // If you're previously hit, you're hit until you're grounded again.
        if (_isHit)
        {
            _isHit = _movement.MovementType != SidescrollingMovementType.Grounded;
        }
    }
예제 #4
0
    private void SpamMagic()
    {
        _movement.ClearHorizontalMovement();

        if (_spiralProjectileSpam.IsDoneSpamming)
        {
            LogMessage("Done spamming magic!  Time to attack.");
            AdvanceToNextAiPhase();
            return;
        }

        _spiralProjectileSpam.FireSomeSpam();
    }
예제 #5
0
    private void CheckHorizontal()
    {
        if (!Input.GetButton("Horizontal"))
        {
            isMovingHorizontally = false;
            _movement.ClearHorizontalMovement();
            return;
        }

        isFacingRight = Input.GetAxis("Horizontal") > 0;

        if (isCrouching)
        {
            return;
        }

        DebugMessage("The player is moving!");
        isMovingHorizontally = true;

        _movement.MoveHorizontally(isFacingRight);
    }
예제 #6
0
 public void BeStill()
 {
     _movement.ClearHorizontalMovement();
 }