/// <summary> /// Event handler for when the music menu entry is selected. /// </summary> void musicMenuEntrySelected(object sender, PlayerIndexEventArgs e) { music = !music; MusicPlayer.Mute(); SetMenuEntryText(); }
/// <summary> /// Event handler for when the Quit Game menu entry is selected. /// </summary> void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { const string message = "Are you sure you want to quit this game?"; MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message); confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted; ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer); }
void RetryGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen(currentLevelNum)); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
/// <summary> /// Event handler for when the Level Select menu entry is selected. /// </summary> void LevelSelectMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new LevelSelectScreen(), e.PlayerIndex); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to exit" message box. /// </summary> void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { ScreenManager.Game.Exit(); }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { if (saveGameData.saveGameData.currentlevel < GameConstants.LEVELS && saveGameData.saveGameData.currentlevel > 1) { LoadingScreen.Load ( ScreenManager, true, e.PlayerIndex, new GameplayScreen ( saveGameData.saveGameData.currentlevel ) ); // loads next level from currentLevel } else { List<String> storytext = new List<String>(); List<String> storytitle = new List<String> (); storytitle.Add ( "Background" ); storytext.Add ( "It's a dark and stormy night. Deep in the depths of his 100-floor evil laboratory, Dr.Frankenbuns was hard at work, scheming new ways to take over the world." ); storytitle.Add ( "???" ); storytext.Add ( "But suddenly, lightning struck the Securitron-Combobulator on the roof of the lab (it was probably a dumb place to put it)." ); storytitle.Add ( "Uh oh!" ); storytext.Add ( "The security systems have gone rogue; the very devices created to keep pesky intruders out are now keeping Dr.Frankenbuns inside." ); storytitle.Add("Watch out!"); storytext.Add("Even Doomba, his typically helpful robot vacuum cleaner, has acquired a thirst for destruction. One thing's for sure - it's going to be a long night."); ScreenManager.AddScreen ( new StoryScreen ( storytext, storytitle, new GameplayScreen ( saveGameData.saveGameData.currentlevel ), saveGameData ), e.PlayerIndex ); } }
/// <summary> /// Event handler for when the Options menu entry is selected. /// </summary> void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex); }
void retryLevelEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen(levelData.currentlevelNum)); }
void mainMenuEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
/// <summary> /// Event handler for when the sound menu entry is selected. /// </summary> void soundMenuEntrySelected(object sender, PlayerIndexEventArgs e) { sound = !sound; SoundEffectPlayer.Mute(); SetMenuEntryText(); }