Beispiel #1
0
 private void PlayInGameAudio()
 {
     if (Form_Introduction.isAudioOn == true)
     {
         inGameAudio.Play(true);
     }
 }
Beispiel #2
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 CheckIfAudioMutedOrNot()
 {
     if (Form_Introduction.isAudioOn == true)
     {
         customAudio.Play(true);
     }
 }
 private void pbAudio_Click(object sender, EventArgs e)
 {
     if (isAudioOn == true)
     {
         isAudioOn     = false;
         pbAudio.Image = new Bitmap(Resources.muted);
         customAudio.StopPlaying();
     }
     else if (isAudioOn == false)
     {
         isAudioOn     = true;
         pbAudio.Image = new Bitmap(Resources.unmuted);
         customAudio.Play(true);
     }
     SavingTheContent();
 }
Beispiel #5
0
 private void CheckIfAudioMutedOrNot(string param_NameOfWavFile)
 {
     if (Form_Introduction.isAudioOn == true)
     {
         CustomAudio customAudio = new CustomAudio(param_NameOfWavFile);
         customAudio.Play(false);
     }
 }