/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); InGame.LoadContent(Content); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { PlayerControls.CheckUniversalInput(); switch (GameState) { //case GameStates.MainMenu: // MainMenu.Update(); // break; case GameStates.InGame: InGame.Update(gameTime); break; default: throw new ArgumentOutOfRangeException(); } // End exits the game if (PlayerControls.Exit) { Exit(); } if (PlayerControls.ToggleFullscreen) { graphics.IsFullScreen = !graphics.IsFullScreen; graphics.ApplyChanges(); } base.Update(gameTime); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.White); spriteBatch.Begin(); switch (GameState) { //case GameStates.MainMenu: // MainMenu.Update(); // break; case GameStates.InGame: InGame.Draw(spriteBatch); break; default: throw new ArgumentOutOfRangeException(); } spriteBatch.End(); base.Draw(gameTime); }