/// <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) { //if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) // Global.GameState = Global.availGameStates.Exiting; mInputManager.GetCurrentInput(_gameTime); // TODO: Add your update logic here switch (Global.GameState) { case Global.availGameStates.Playing: mSceneManager.Update(_gameTime); mAIManager.Update(_gameTime); if (mCamera != null) { mCamera.Update(_gameTime); } mCollisionManager.CollisionDetec(); break; case Global.availGameStates.Menu: mMenuManager.Update(_gameTime); break; case Global.availGameStates.Exiting: Exit(); break; case Global.availGameStates.Resuming: // IsMouseVisible = false; Global.GameState = Global.availGameStates.Playing; break; } base.Update(_gameTime); }