public Game1() { FileHandler.writeToFile(systemOptions, @"Content\Data\system_variables.xml", new XmlSerializer(typeof(SystemOptions))); systemOptions = FileHandler.readFromFile(@"Content\Data\system_variables.xml", new XmlSerializer(typeof(SystemOptions))); new GraphicsDeviceManager(this) { PreferredBackBufferWidth = systemOptions.resolutionWidth, PreferredBackBufferHeight = systemOptions.resolutionHeight, IsFullScreen = systemOptions.fullScreen }; Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); screenRectangle = new Rectangle(0, 0, systemOptions.resolutionWidth, systemOptions.resolutionHeight); startMenuScreen = new StartMenuScreen(this, stateManager); Level1 = new Level1(this, stateManager); Level2 = new Level2(this, stateManager); characterCreationScreen = new CharacterCreationScreen(this, stateManager); pauseScreen = new PauseScreen(this, stateManager); optionsScreen = new OptionsScreen(this, stateManager); loadGameScreen = new LoadGameScreen(this, stateManager); gameLoseScreen = new GameLoseScreen(this, stateManager); lobbyScreen = new LobbyScreen(this, stateManager); highScoreScreen = new HighScoresScreen(this, stateManager); stateManager.ChangeState(startMenuScreen); }
private void LoadHighScores() { SpriteFont labelSpriteFont = Content.Load <SpriteFont>(@"Fonts/Input"); SpriteFont title = Content.Load <SpriteFont>(@"Fonts/Title"); _highScores = new HighScoresScreen(labelSpriteFont, title, _back); }
public Root(GameLogic model) { Model = model; HighScores = new HighScoresScreen(this); }