Beispiel #1
0
 public void PassTurn()
 {
     whiteTurn = !whiteTurn;
     if (whiteTurn)
     {
         player1Name.color = Color.blue;
         player2Name.color = Color.black;
     }
     else
     {
         player1Name.color = Color.black;
         player2Name.color = Color.blue;
     }
     StopAllCoroutines();
     timerOn = false;
     // Check for checkmate
     if (board.CheckIfCheckMate(whiteTurn))
     {
         print("Checkmate Atheists!");
         board.moveList.Add(new Move(board.moveNum, whiteTurn, true));
         if (whiteTurn)
         {
             player1Name.color = Color.red;
             tournamentManager.PlayerLostGame(true);
             gameActive = false;
         }
         else
         {
             player2Name.color = Color.red;
             tournamentManager.PlayerLostGame(false);
             gameActive = false;
         }
     }
     // Check if game is a draw
     else if (board.CheckDraw(whiteTurn))
     {
         tournamentManager.DrawGame();
         player1Name.color = Color.green;
         player2Name.color = Color.green;
         Debug.Log("Game is a draw!");
         gameActive = false;
     }
 }