Esempio n. 1
0
        private void GameOver()
        {
            timerGame.Stop();
            lblScore.Text  = "Score: " + Top10Only.AddingCommasInScore(Convert.ToString(score));
            lblMissed.Text = "Missed: " + missedEggs;
            Top10Only.CheckResultInTop10Only(dateToday, score);
            inGameAudio.StopPlaying();
            if (Form_Introduction.isAudioOn == true)
            {
                gameOverAudio.Play(false);
            }
            DialogResult result = MessageBox.Show("Score: " + score + Environment.NewLine + "Missed: " + missedEggs + Environment.NewLine + Environment.NewLine + "Do you want to play again?", "GAME OVER", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (result == DialogResult.Yes)
            {
                gameOverAudio.StopPlaying();
                StartGame();
            }
            else if (result == DialogResult.No)
            {
                gameOverAudio.StopPlaying();
                this.Hide();
                Form_Introduction nextForm = new Form_Introduction();
                nextForm.ShowDialog();
            }
        }
        private void btnBack_Click(object sender, EventArgs e)
        {
            customAudio.StopPlaying();
            this.Hide();
            Form_Introduction nextForm = new Form_Introduction();

            nextForm.Show();
        }