Exemple #1
0
 public void CleanBoard()
 {
     Board.CleanBoard();
     RoundScreen.ResetTriggerRoundWinScreen();
     _IsGameOver = false;
     RunAIIfCan();
 }
Exemple #2
0
    public Original(Game1 game) : base(game)
    {
        bulletScreen = new BulletScreen(game);
        hitScreen    = new HitScreen(game);
        roundScreen  = new RoundScreen(game);
        scoreScreen  = new ScoreScreen(game);

        AddDucks(1);
    }
Exemple #3
0
    public static void DetermineWinnerOfRound(PieceType type)
    {
        if (LevelManager._isPlayer1Red)
        {
            if (_isPlayerTurn == PieceType.RED)
            {
                _Player1Points++;
            }
            else
            {
                _Player2Points++;
            }
        }
        else
        {
            if (_isPlayerTurn == PieceType.RED)
            {
                _Player2Points++;
            }
            else
            {
                _Player1Points++;
            }
        }
        CurrentScore.UpdateScoreText(GetCurrentPlayerName());

        int winningScore = (int)(((float)LevelManager.GetNumberOfRounds() / 2) + 1);

        if (winningScore <= _Player1Points || winningScore <= _Player2Points)//Game is won
        {
            UltimateWinner.UpdateUltimateWinnerText(GetCurrentPlayerName());
            Results.UpdateResultsText();
            SaveMatch();
            WinScreen.TriggerWinScreen();
            _IsGameOver = true;
        }
        else//round won
        {
            RoundScreen.TriggerRoundWinScreen();
            RoundWinner.UpdateRoundWinnerText(GetCurrentPlayerName());
            _IsGameOver = true;
        }
    }
Exemple #4
0
 public static void CheckWinner(Vector2Int startingPoint, PieceType type)
 {
     if (CheckHorizontal(startingPoint, type) ||
         CheckDiagTLDR(startingPoint, type) ||
         CheckDiagDLTR(startingPoint, type) ||
         CheckDown(startingPoint, type))
     {
         //Determine who actually one and if there's an ultimate winner
         MatchManager.DetermineWinnerOfRound(type);
         MatchManager._CanPlay = false;
     }
     else if (GridIsFull())//Theres no more moves left
     {
         RoundScreen.TriggerRoundWinScreen();
         RoundWinner.UpdateRoundWinnerText("TIE! No one");
         MatchManager._IsGameOver = true;
     }
     else
     {
         MatchManager._CanPlay = true;
         MatchManager.EndTurn();
     }
 }