protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here currentState = new MenuState(this, _graphics.GraphicsDevice, Content); }
protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } // TODO: Add your update logic here //changes state when button is clicked if (nextState != null) { currentState = nextState; nextState = null; } currentState.Update(gameTime); currentState.PostUpdate(gameTime); base.Update(gameTime); }
public void changeState(State.State state) { nextState = state; }