public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; ScreenRectangle = new Rectangle( 0, 0, screenWidth, screenHeight); Content.RootDirectory = "Content"; Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); TitleScreen = new TitleScreen(this, stateManager); StartMenuScreen = new StartMenuScreen(this, stateManager); GamePlayScreen = new GamePlayScreen(this, stateManager); CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager); LoadGameScreen = new LoadGameScreen(this, stateManager); SkillScreen = new GameScreens.SkillScreen(this, stateManager); stateManager.ChangeState(TitleScreen); this.IsFixedTimeStep = false; graphics.SynchronizeWithVerticalRetrace = false; }
public Game1() { _graphics = new GraphicsDeviceManager(this); ScreenRectangle = new Rectangle( 0, 0, ScreenWidth, ScreenHeight); IsMouseVisible = true; Content.RootDirectory = "Content"; Components.Add(new InputHandler(this)); _gameStateManager = new GameStateManager(this); Components.Add(_gameStateManager); _ = new TextureManager(); TitleScreen = new TitleScreen(this, _gameStateManager); StartMenuScreen = new StartMenuScreen(this, _gameStateManager); GamePlayScreen = new GamePlayScreen(this, _gameStateManager); CharacterGeneratorScreen = new CharacterGeneratorScreen(this, _gameStateManager); SkillScreen = new SkillScreen(this, _gameStateManager); LoadGameScreen = new LoadGameScreen(this, _gameStateManager); ConversationScreen = new ConversationScreen(this, _gameStateManager); ShopScreen = new ShopState(this, _gameStateManager); InventoryScreen = new InventoryScreen(this, _gameStateManager); _gameStateManager.ChangeState(TitleScreen); IsFixedTimeStep = false; _graphics.SynchronizeWithVerticalRetrace = false; }
private void LoadLoadScreen() { Texture2D loadButton = Content.Load <Texture2D>(@"Images/LoadGame/Load"); SpriteFont labelSpriteFont = Content.Load <SpriteFont>(@"Fonts/Input"); _loadGame = new LoadGameScreen(loadButton, labelSpriteFont, _back); }
public void openLoadGameMenu() { _loadGameScreen = _loadGameScreen ?? new LoadGameScreen(this); _loadGameScreen.loadPlayerSaves(); _loadGameScreen.applyIntroTransitions(); _screenSystem.addScreen(_loadGameScreen); }
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); }
/* The PokemonEngine() constructor initializes all of the important parts of the engine, including managers and screens. */ public PokemonEngine() { /* The GraphicsDeviceManager is initialized, and the PreferredBackBuffer properties are set to the constants screenWidth and screenHeight. * This means that the engine window will have these dimensions, if possible. * The ScreenRectangle is also initialized with a position of zero and the screen width and height. */ graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; ScreenRectangle = new Rectangle(0, 0, screenWidth, screenHeight); /* The two vital components of the engine, the InputHandler and the GameStateManager, are initialized and added to the engine's master component list. * Whenever base.Update() and base.Draw() are called from this class, everything on the component list is updated and drawn. * Since these classes contain all code for handling input and for drawing the game states, everything will now be updated and drawn properly. */ Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); /* Every screen is initialized. Each has a reference to the engine and the state manager passed in. */ SplashScreen = new SplashScreen(this, stateManager); StartScreen = new StartScreen(this, stateManager); WorldScreen = new WorldScreen(this, stateManager); CharacterSelectScreen = new CharacterSelectScreen(this, stateManager); LoadGameScreen = new LoadGameScreen(this, stateManager); StarterSelectScreen = new StarterSelectScreen(this, stateManager); InventoryScreen = new InventoryScreen(this, stateManager); BattleScreen = new BattleScreen(this, stateManager); SwitchScreen = new SwitchScreen(this, stateManager); /* The state stack is reset and the SplashScreen is pushed on. This means the first thing to appear when the engine is run will be the SplashScreen. */ stateManager.ChangeState(SplashScreen); /* The content root directory is set to the "/Content/" folder, meaning every filename string passed to Content.Load<T>() will start in this folder. */ Content.RootDirectory = "Content"; /* Type matchups are initialized in the PkmnUtils class, which creates the type advantage lookup table. */ PkmnUtils.InitTypeMatchups(); /* These two settings make the game run as many times per second as it can. * They could be changed later depending on how well the engine performs. */ IsFixedTimeStep = false; graphics.SynchronizeWithVerticalRetrace = false; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { _SpriteBatch = new SpriteBatch(GraphicsDevice); Content.RootDirectory = "Content"; //ResourceContentManager content = new ResourceContentManager(this.Services, Resources.Resources.ResourceManager); //5 - Initialise graphic contents ImageManager.InitImageManager(this.GraphicsDevice, this._SpriteBatch); FontManager.LoadFonts(Content, null); //TODO //6 - Load Screens _LoadingGameScreen = new LoadGameScreen(this, this._SpriteBatch); _TitleScreen = new TitleScreen(this, this._SpriteBatch); _StageScreen = new StageScreen(this, this._SpriteBatch); _CurrentScreen = _LoadingGameScreen; //7 - Listen for screen changement _CurrentScreen.ChangingScreen += new Screen.ChangeScreenEventHandler(OnChangingScreen); this.Components.Add(_LoadingGameScreen); }
public void CloseLoad() { LoadGameScreen.SetActive(false); }
public void OpenLoad() { LoadGameScreen.SetActive(true); }