/// <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)) { GameState.IsShowMainMenuScene = true; } // TODO: Add your update logic here InputManager.Update(); if (GameState.IsShowMainMenuScene) { menuScene.Update(); } else if (GameState.IsShowGameScene) { gameScene.Update(); } else if (GameState.IsRankingScene) { rankingScene.Update(); } else if (GameState.IsPlayerNameScene) { playerNameScene.Update(); } base.Update(gameTime); }
/// <summary> /// Main update loop of the game /// </summary> /// <param name="gameTime"></param> protected override void Update(GameTime gameTime) { switch (_gameState) { case GameState.MainMenu: Menu.Update(gameTime); break; case GameState.LoggedIn: CharacterSelect.Update(gameTime); break; case GameState.RegisterAccount: RegisterAccount.Update(gameTime); break; case GameState.CreateCharacter: CharacterCreate.Update(gameTime); break; case GameState.Playing: GameScence.Update(gameTime); break; } base.Update(gameTime); }
internal override void Update(GameTime gameTime) { switch (Data.currentState) { case Data.GameStates.Menu: ms.Update(gameTime); break; case Data.GameStates.Game: break; case Data.GameStates.Settings: break; } }
protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { Exit(); } if (Menu.IsShowMainMenuScene) { menuScene.Update(gameTime); } if (Menu.IsShowGameScene) { gameScene.Update(gameTime); } base.Update(gameTime); }