private void AnswerCountdown(object sender, EventArgs e) { sec++; if (sec == 2) { if (CurrentRegion == 5) { CanPlay = true; Hint.Begin(); SequenceIMG1.Visibility = SequenceIMG2.Visibility = SequenceIMG3.Visibility = SequenceIMG4.Visibility = SequenceIMG5.Visibility = sequence_Required.Visibility = failed.Visibility = Visibility.Visible; PlayGameBTN.Visibility = Visibility.Collapsed; Randomizer(maxIndex); MSG.Visibility = Visibility.Visible; return; } if (CurrentRegion == 3) { drum4 = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound drum4.Open(new Uri(System.IO.Path.GetFullPath("sfx/Crash.wav"))); //Open the file for a media playback drum4.Play(); Drum4.Begin(); } if (CurrentRegion == 2) { drum3 = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound drum3.Open(new Uri(System.IO.Path.GetFullPath("sfx/Tom-05.wav"))); //Open the file for a media playback drum3.Play(); Drum3.Begin(); } if (CurrentRegion == 1) { drum2 = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound drum2.Open(new Uri(System.IO.Path.GetFullPath("sfx/Tom H.wav"))); //Open the file for a media playback drum2.Play(); Drum2.Begin(); } if (CurrentRegion == 0) { drum1 = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound drum1.Open(new Uri(System.IO.Path.GetFullPath("sfx/Tom L.wav"))); //Open the file for a media playback Drum1.Begin(); drum1.Play(); } if (maxIndex == maxGameIndex) { return; } if (CurrentRegion == sequence[correct]) { //Swsto correct++; // HideBasedOnCorrect(); if (correct == maxIndex) { correctSequence = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound correctSequence.Open(new Uri(System.IO.Path.GetFullPath("sfx/choice2.wav"))); //Open the file for a media playback correctSequence.Play(); index = 0; correct = 0; maxIndex += 1; if (maxIndex == maxGameIndex) { s.Stop(); WIN = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound WIN.Open(new Uri(System.IO.Path.GetFullPath("sfx/Hotel 1 Level Complete.mp3"))); //Open the file for a media playback WIN.Play(); Hotel_1_3___New_mp3.Volume = 0; Hotel_1_3___New_mp3.IsMuted = true; MSG.Text = "You Win!"; failed.Visibility = LETTERSTACKPANEL.Visibility = sequence_Required.Visibility = Visibility.Collapsed; } else { ReturnFeedback(); MSG.Text = "Round " + (maxIndex - 4).ToString(); Randomizer(maxIndex); } } HideBasedOnCorrect(); } else { if (maxIndex != maxGameIndex) { drum1 = new MediaPlayer(); //Initialize a new instance of MediaPlayer of name countingSound drum1.Open(new Uri(System.IO.Path.GetFullPath("sfx/failure1.wav"))); //Open the file for a media playback drum1.Play(); ResetSequence(); } } } }