public ResultPage() { InitializeComponent(); this.DataContext = this; DTimer = new DispatcherTimer(); DTimer.Interval = new TimeSpan(0, 0, 0, 0, 30); DTimer.Tick += DTimer_Tick; BG_Player.Pause(); BG_PlayerScore.Play(); DTimer.Start(); frameScore = frameTime = 0; Result(); TypeGame(); }
private void DTimer_Tick(object sender, EventArgs e) { try { if (frameScore >= Global.GameScore) { Score_Result = "Score: " + Global.GameScore; frameScore = Global.GameScore; bScore = true; } else { frameScore += 1; Score_Result = "Score: " + frameScore; } if (frameTime >= Global.GameTime) { Time_Result = "Time: " + Global.GameTime; frameTime = Global.GameTime; bTime = true; } else { frameTime += 1; Time_Result = "Time: " + frameTime; } if (bScore && bTime) { BG_PlayerScore.Stop(); BG_Player.Play(); DTimer.Stop(); } } catch { } }
private void BG_Player_MediaEnded(object sender, RoutedEventArgs e) { BG_Player.Play(); }