protected override void Update(GameTime gameTime) { GameTime = gameTime; Input.Update(); // Allows the game to exit if (Input.WasButtonPressed(Buttons.Back) || Input.WasKeyPressed(Keys.Escape)) { this.Exit(); } if (Input.WasKeyPressed(Keys.P)) { paused = !paused; } if (Input.WasKeyPressed(Keys.B)) { useBloom = !useBloom; } if (!paused) { PlayerStatus.Update(); EntityManager.Update(); EnemySpawner.Update(); ParticleManager.Update(); Grid.Update(); } base.Update(gameTime); }
/// <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) { GameTime = gameTime; if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } EntityManager.Update(); Input.Update(); EnemySpawner.Update(); PlayerStatus.Update(); base.Update(gameTime); }