private void TitleScreenEvent(object obj, EventArgs e) { // Depending on the choice in TitleScreen, change screen. if (menuChoice == MenuChoices.StartGame) mCurrentScreen = mInGameScreen; else if (menuChoice == MenuChoices.Highscores) mCurrentScreen = new HighscoreScreen(this.Content, new EventHandler(HighscoreScreenEvent), this); else if (menuChoice == MenuChoices.Unlockables) mCurrentScreen = new UnlockablesScreen(this.Content, new EventHandler(UnlockablesScreenEvent), this); else if (menuChoice == MenuChoices.Options) mCurrentScreen = mOptionsScreen; menuChoice = MenuChoices.Empty; }
private void UnlockablesScreenEvent(object obj, EventArgs e) { mCurrentScreen = mTitleScreen; }
private void OptionsScreenEvent(object obj, EventArgs e) { mCurrentScreen = mTitleScreen; }
private void InGameEvent(object obj, EventArgs e) { mCurrentScreen = mTitleScreen; mInGameScreen = new InGameScreen(this.Content, new EventHandler(InGameEvent), this); }
private void HighscoreScreenEvent(object obj, EventArgs e) { mCurrentScreen = mTitleScreen; }
private void ControlDetectorScreenEvent(object obj, EventArgs e) { mCurrentScreen = mTitleScreen; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. mTitleScreen = new TitleScreen(this.Content, new EventHandler(TitleScreenEvent), this); mInGameScreen = new InGameScreen(this.Content, new EventHandler(InGameEvent), this); mOptionsScreen = new OptionsScreen(this.Content, new EventHandler(OptionsScreenEvent), this, graphics); mHighscoreScreen = new HighscoreScreen(this.Content, new EventHandler(HighscoreScreenEvent), this); mUnlockablesScreen = new UnlockablesScreen(this.Content, new EventHandler(UnlockablesScreenEvent), this); mCurrentScreen = mTitleScreen; }