private void selectOpt() { switch (curOpt) { case opt.returnStart: App.joyDown -= new EventHandler<JoyDownArgs>(score_joyDown); StartWindow start = new StartWindow(); App.Current.MainWindow = start; start.Show(); this.Close(); break; case opt.clearScores: this.confirmNo.Visibility = Visibility.Visible; this.confirmYes.Visibility = Visibility.Visible; this.confirmAsk.Visibility = Visibility.Visible; this.returnStart.Visibility = Visibility.Collapsed; this.clearScores.Visibility = Visibility.Collapsed; updateFont(opt.confirmNo); break; case opt.confirmYes: scoreboardContext.resetBoard(); App.joyDown -= new EventHandler<JoyDownArgs>(score_joyDown); ScoreboardWindow score = new ScoreboardWindow(); App.Current.MainWindow = score; score.Show(); this.Close(); break; case opt.confirmNo: this.confirmNo.Visibility = Visibility.Collapsed; this.confirmYes.Visibility = Visibility.Collapsed; this.confirmAsk.Visibility = Visibility.Collapsed; this.returnStart.Visibility = Visibility.Visible; this.clearScores.Visibility = Visibility.Visible; updateFont(opt.clearScores); break; } }
private void pause_selectOpt() { switch (curOpt) { case opt.resume: if (game_paused) { this.pause_header.Visibility = Visibility.Collapsed; this.pause_leftShip.Visibility = Visibility.Collapsed; this.pause_rightShip.Visibility = Visibility.Collapsed; this.pause_resume.Visibility = Visibility.Collapsed; this.pause_returnToStart.Visibility = Visibility.Collapsed; this.pause_exitGame.Visibility = Visibility.Collapsed; this.pause_background.Opacity = 0; if (countdownOn) this.count.Visibility = Visibility.Visible; p1_ship.speed.X = 0; p1_ship.speed.Y = 0; p2_ship.speed.X = 0; p2_ship.speed.Y = 0; game_paused = false; } else { App.joyDown -= new EventHandler<JoyDownArgs>(main_joyDown); App.joyUp -= new EventHandler<JoyUpArgs>(main_joyUp); MainWindow main = new MainWindow(TwoPlayer, diff, p1_in, p2_in); App.Current.MainWindow = main; main.Show(); this.Close(); } break; case opt.returnToStart: App.joyDown -= new EventHandler<JoyDownArgs>(main_joyDown); App.joyUp -= new EventHandler<JoyUpArgs>(main_joyUp); StartWindow start = new StartWindow(); App.Current.MainWindow = start; start.Show(); this.Close(); break; case opt.exitGame: System.Environment.Exit(0); break; } }
private void selectOpt() { switch(curOpt) { case opt.startGame: if (validConfig) { App.joyDown -= new EventHandler<JoyDownArgs>(setup_joyDown); MainWindow main = new MainWindow(TwoPlayer, diff, p1_in, p2_in); App.Current.MainWindow = main; main.Show(); this.Close(); } break; case opt.returnToStart: App.joyDown -= new EventHandler<JoyDownArgs>(setup_joyDown); StartWindow start = new StartWindow(); App.Current.MainWindow = start; start.Show(); this.Close(); break; } }