public void LoadLevel(string worldData) { var gameStartParameters = new GameStartParameters { WorldToLoad = worldData, WorldLoader = new WorldLoaderForTest() }; var gamePlayScreen = new GameplayScreen(gameStartParameters, new InputState()); this._world = gamePlayScreen.LoadWorld(worldData); GlobalServices.SetWorld(this._world); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { this._headsUpDisplay.LoadContent(this._content); this._world = LoadWorld(this._gameStartParameters.WorldToLoad); this._world.LoadContent(this._content); GlobalServices.SetWorld(this._world); // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); this.ScreenManager.Game.Deactivated += GameOnDeactivated; }