Beispiel #1
0
 private void gameAdvance()
 {
     if (board.isGameOverBySnakeAdvancing())
     {
         isGameOver = true;
         if (board.HasWon)
         {
             if (Settings.Instance.IsSoundsOn)
             {
                 SoundPlayer winningSound = new SoundPlayer(Properties.Resources.claps);
                 winningSound.Play();
             }
             WinningWindow winningWindow = new WinningWindow();
             winningWindow.ShowDialog();
             Close();
         }
         else
         {
             LosingWindow losingWindow = new LosingWindow();
             losingWindow.ShowDialog();
             Close();
         }
     }
     else
     {
         eatToBeatCount.Text = board.RemainingFood.ToString();
     }
     visualBoard.Refresh();
 }