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; } }