/// <summary> /// Screen update logic /// </summary> /// <param name="gameTime"></param> /// <param name="otherScreenHasFocus"></param> /// <param name="coveredByOtherScreen"></param> public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { // If necessary, load the highscore. Remember that calling LoadHighscores multiple times does not have // and adverse effect. Highscore will only be loaded once. if (!HighScoreScreen.HighscoreLoaded) { HighScoreScreen.LoadHighscores(); } // If additional thread is running, do nothing else if (null != thread) { // If additional thread finished loading and the screen is not exiting if (thread.ThreadState == ThreadState.Stopped && !IsExiting) { // Move on to the game play screen once highscore data is loaded foreach (GameScreen screen in ScreenManager.GetScreens()) { screen.ExitScreen(); } ScreenManager.AddScreen(gameplayScreen, null); } } base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { HighScoreScreen.LoadHighscores(); base.LoadContent(); }