Example #1
0
        public override void LoadContent()
        {
            gameplayHelper = PhoneApplicationService.Current.State[DodgeGame.GameStateKey] as GameplayHelper;

            PhoneApplicationService.Current.State[DodgeGame.InGameKey] = true;

            base.LoadContent();
        }
Example #2
0
        void BackgroundLoadContent()
        {
            GameplayHelper gameplayHelper;

            // If we have never created a gameplay helper yet, now is the time. Otherwise, we simply need to reload its content, possibly
            if (PhoneApplicationService.Current.State.ContainsKey(DodgeGame.GameStateKey))
            {
                gameplayHelper = PhoneApplicationService.Current.State[DodgeGame.GameStateKey] as GameplayHelper;
            }
            else
            {
                gameplayHelper = new GameplayHelper(ScreenManager.Game.Content, ScreenManager.SpriteBatch,
                        ScreenManager.Game.GraphicsDevice);

                PhoneApplicationService.Current.State[DodgeGame.GameStateKey] = gameplayHelper;
            }

            if ((ScreenManager.Game as DodgeGame).ReloadRequired)
            {
                gameplayHelper.InitializeAssets(ScreenManager.Game.Content, ScreenManager.SpriteBatch, ScreenManager.Game.GraphicsDevice);

                gameplayHelper.LoadContent();

                (ScreenManager.Game as DodgeGame).GameplayHelper = gameplayHelper;
            }
        }