예제 #1
0
        public static void PlayGame()
        {
            player.ResetPlayerLife();
            Word.SetDifficulty(ConsolePresenter.GetDifficilty());

            while (player.Life > 0)
            {
                ConsolePresenter.DrawGame(player, word.SecretWord, word.ShownedWord);
                if (Word.CheckLetter(ConsolePresenter.AskForLetter()))
                {
                    player.AddScore(3);
                }
                else
                {
                    player.RemoveScore(1);
                    player.LifeLoss();
                }
                if (Word.WordComplete())
                {
                    highscore.Score = player.Score;
                    ConsolePresenter.DrawWinning(word.SecretWord, player.PlayerName, player.Score);
                    Console.WriteLine();
                    break;
                }
            }
            if (player.Life <= 0)
            {
                highscore.Score = player.Score;
                ConsolePresenter.PrintSecretWord(word.SecretWord, player.Score);
            }
        }
예제 #2
0
 public static void SetupGame()
 {
     Console.Clear();
     ConsolePresenter.PrintBanner();
     player.PlayerName    = ConsolePresenter.GetPlayerName();
     highscore.PlayerName = player.PlayerName;
     player.ResetPlayerScore();
 }
예제 #3
0
 public static void GameStartUp()
 {
     Console.Clear();
     ConsolePresenter.PrintBanner();
     ConsolePresenter.PrintWelcome();
     ConsolePresenter.PrintRules();
     ConsolePresenter.PrintAlternative(highscore);
 }
예제 #4
0
 static void Main(string[] args)
 {
     Console.Title = "Hangman 1.1 CCS Games";
     while (playGame)
     {
         Game.GameStartUp();
         bool gameContinues = true;
         while (gameContinues)
         {
             Game.PlayGame();
             gameContinues = ConsolePresenter.AskPlayAgain();
         }
         Game.SaveHighscore();
     }
 }