private void CheckIfAudioMutedOrNot()
 {
     if (Window_Introduction.isAudioOn == true)
     {
         customAudio.Play(true);
     }
 }
Example #2
0
 private void PlayInGameAudio()
 {
     if (Window_Introduction.isAudioOn == true)
     {
         inGameAudio.Play(true);
     }
 }
Example #3
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();
            }
        }
Example #4
0
 private void CheckIfAudioMutedOrNot(string param_NameOfWavFile)
 {
     if (Window_Introduction.isAudioOn == true)
     {
         CustomAudio customAudio = new CustomAudio(param_NameOfWavFile);
         customAudio.Play(false);
     }
 }
 private void btnAudio_Click(object sender, RoutedEventArgs e)
 {
     if (isAudioOn == true)
     {
         isAudioOn        = false;
         btnAudio.Content = new Image
         {
             Source = new BitmapImage(new Uri("pack://application:,,,/Images/muted.png"))
         };
         customAudio.StopPlaying();
     }
     else if (isAudioOn == false)
     {
         isAudioOn        = true;
         btnAudio.Content = new Image
         {
             Source = new BitmapImage(new Uri("pack://application:,,,/Images/unmuted.png"))
         };
         customAudio.Play(true);
     }
     SavingTheContent();
 }