//Add players to arrayList public void addPlayers() { player0 = new Player("Yellow"); player1 = new Player("Red"); player2 = new Player("Blue"); player3 = new Player("Green"); Players.Add(player0); Players.Add(player1); Players.Add(player2); Players.Add(player3); currentPlayer = player1; playerIndex = 0; }
//Check guessed letter in phrase public void checkLetterInPhrase(char character) { for(int i = 0; i < phraseToGuess.Length; i++) { if (displayedPhrase[i] == '_') { if (phraseToGuess[i] == character) { displayedPhrase[i] = character; correctGuess = true; } } } if (!correctGuess) { //Lose Limb currentPlayer.removeLimb("Head"); } else { correctGuess = false; } Console.WriteLine(displayedPhrase); if (!checkEndGame()) { //Next Turn playerIndex++; if (playerIndex >= Players.Count) { playerIndex = 0; } currentPlayer = (Player) Players[playerIndex]; Console.WriteLine(displayName()); } }