Exemple #1
0
    protected override Vector2 GetTargetPosition()
    {
        Vector2 targetPosition;

        if (returningToSpawn)
        {
            targetPosition = new Vector2(6.5f, 8.5f);
        }
        else if (GameManager.Instance.gameState == States.SCATTER)
        {
            targetPosition = scatterTarget;
        }
        else
        {
            // Inky's target uses both the player and Blinky
            Vector2 tempTargetPosition = (Vector2)player.transform.position + (GetVectorFromDirection(player.GetCurrentDirection()) * 1.0f);
            Vector2 blinkyPosition     = blinky.transform.position;
            Vector2 direction          = (tempTargetPosition - blinkyPosition).normalized;
            float   mag = (tempTargetPosition - blinkyPosition).magnitude;
            targetPosition = blinkyPosition + direction * mag * 2.0f;
        }

        return(targetPosition);
    }
Exemple #2
0
    protected override Vector2 GetTargetPosition()
    {
        Vector2 targetPosition;

        if (returningToSpawn)
        {
            targetPosition = new Vector2(6.5f, 8.5f);
        }
        else if (GameManager.Instance.gameState == States.SCATTER)
        {
            targetPosition = scatterTarget;
        }
        else
        {
            // Pinky's target is ahead of the player
            targetPosition = (Vector2)player.transform.position + (GetVectorFromDirection(player.GetCurrentDirection()) * 2.0f);
        }

        return(targetPosition);
    }