Exemple #1
0
 public bool DecreaseLives()
 {
     if (dwarfLives > 1)
     {
         this.dwarfLives--;
         this.ShowLives();
         return(true);
     }
     else
     {
         FallingRocks.GameOver(); // needs to be redone properly
         return(false);
     }
 }
Exemple #2
0
        public void Quit()
        {
            ConsoleKeyInfo readKey;
            int            x = fieldWidth / 2;
            int            y = fieldHeight / 2;

            lock (FallingRocks.syncObject)
            {
                this.Print(x - 22, y - 2, x + 22, y + 2);
                WriteAt(x - 20, y, "Do you really want to leave the game Y/N? ", 12);
                do
                {
                    readKey = Console.ReadKey(true);
                } while (!(readKey.KeyChar == 'y' || readKey.KeyChar == 'Y' || readKey.KeyChar == 'n' || readKey.KeyChar == 'N'));
                if (readKey.KeyChar == 'n' || readKey.KeyChar == 'N')
                {
                    this.Clear(x - 22, y - 2, x + 22, y + 2);
                }
                else
                {
                    FallingRocks.GameOver();
                }
            }
        }