Esempio n. 1
0
        private void GameOver()
        {
            lblMissed.Content = "Missed: " + missedBalloons;
            isGameActive      = false;
            timerGame.Stop();
            Top10Only.CheckResultInTop10Only(dateToday, Convert.ToInt32(score));
            inGameAudio.StopPlaying();
            if (Window_Introduction.isAudioOn == true)
            {
                gameOverAudio.Play(false);
            }
            MessageBoxResult result = MessageBox.Show("Your Score: " + score + Environment.NewLine + "Missed: " + missedBalloons + Environment.NewLine + Environment.NewLine + "Do you want to play again?", "GAME OVER", MessageBoxButton.YesNo, MessageBoxImage.Information);

            if (result == MessageBoxResult.Yes)
            {
                gameOverAudio.StopPlaying();
                StartGame();
            }
            else if (result == MessageBoxResult.No)
            {
                gameOverAudio.StopPlaying();
                Window_Introduction nextWindow = new Window_Introduction();
                this.Visibility = Visibility.Collapsed;
                nextWindow.ShowDialog();
            }
        }
        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            customAudio.StopPlaying();
            Window_Introduction nextWindow = new Window_Introduction();

            this.Visibility = Visibility.Collapsed;
            nextWindow.ShowDialog();
        }