示例#1
0
 public void GameOver()
 {
     timer1.Stop();
     exitGameBtn = false;
     mainSound.Stop();
     gameOverS.Play();
     EndGame form = new EndGame();
     form.ShowDialog();
     player = new Player(form.NameP, ballCollection.Score);
     playersScore.Add(player);
     writeFile();
     if (form.End == 0)
     {
         newGame();
         sw.Flush();
     }
     else if (form.End == 1)
     {
         this.Close();
         sw.Close();
     }
 }
示例#2
0
        public void endGame()
        {
            exitGameBtn = false;
            timer1.Stop();
            mainSound.Stop();
            EndGame form = new EndGame();
            form.ShowDialog();
            player = new Player(form.NameP, Score);
            playersScore.Add(player);
            writeFile();
            if (form.End == 0)
            {
                Score = 0;
                runGame();

            }
            else if (form.End == 1)
            {
                this.Close();
                sw.Close();
            }
        }