Esempio n. 1
0
    public override void NotifyGoal(GoalPosition position)
    {
        int dir = 1;

        if (position == GoalPosition.North)
        {
            playerScore++;
            Manager.UI.SouthScore.SetScore(playerScore);
            dir = 1;
        }
        else if (position == GoalPosition.South)
        {
            computerScore++;
            Manager.UI.NorthScore.SetScore(computerScore);
            dir = -1;
        }

        if (playerScore >= 5)
        {
            EndGame("You win!");
        }
        else if (computerScore >= 5)
        {
            EndGame("You lose!");
        }
        else
        {
            StartCoroutine(LaunchBall(dir));
        }
    }
Esempio n. 2
0
 private void setDistancesFromGoal()
 {
     for (int i = 0; i < Height; i++)
     {
         for (int j = 0; j < Width; j++)
         {
             this.BlockData[i, j].DistanceFromGoal = GoalPosition.distanceFromCoord(i, j);
         }
     }
 }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        stayPos = null;
        sej     = GameObject.FindGameObjectWithTag("Goal").GetComponent <StageEndJudge>();
        GameObject goal = GameObject.Find("Goal");

        if (goal == null)
        {
            goal = GameObject.Find("FlowGoal");
        }
        gp = goal.GetComponent <GoalPosition>();
    }
Esempio n. 4
0
 public override void NotifyGoal(GoalPosition position)
 {
     if (authoritative)
     {
         if (position == GoalPosition.North)
         {
             HandleGoal(Player.Server);
         }
         else if (position == GoalPosition.South)
         {
             HandleGoal(Player.Client);
         }
     }
     else
     {
         ball.Freeze();
         ballGO.SetActive(false);
     }
 }
Esempio n. 5
0
 public abstract void NotifyGoal(GoalPosition position);