public void Update() { this._deviceState = new DeviceControllerState(); if (GamePad.GetState(0).Buttons.Back == ButtonState.Pressed) { _deviceState.Q = true; } }
public void Update() { this._gameBase.DeviceController.Update(); DeviceControllerState inputState = this._gameBase.DeviceController.GetInputState(); if (inputState.Q) { this._gameBase.GameState = new GameStateQuit(this._gameBase); } }
public void Update() { //controls this._gameBase.DeviceController.Update(); DeviceControllerState inputState = this._gameBase.DeviceController.GetInputState(); if (inputState.Q) { this._gameBase.GameState = new GameStateQuit(this._gameBase); } else if (inputState.P) { IGameState lastGameState = this._gameBase.GameState; this._gameBase.GameState = new GameStatePaused(this._gameBase, lastGameState); } //game state switch (this._battle.BattleState) { case EnumBattleState.Start: break; case EnumBattleState.Playing: break; case EnumBattleState.Finished: if (this._battle.Winner.ID == this._battle.PlayerDown.ID) { IGameState lastgame = this._gameBase.GameState; this._gameBase.GameState = new GameStatePlayerWin(_gameBase, lastgame); } else if (this._battle.Winner.ID == this._battle.PlayerTop.ID) { IGameState lastgame = this._gameBase.GameState; this._gameBase.GameState = new GameStatePlayerLose(_gameBase, lastgame); } break; case EnumBattleState.Draw: break; default: break; } this._battle.Update(); }
public void Update() { this._deviceState = new DeviceControllerState(); _keysLast = _keysCurrent; _keysCurrent = Keyboard.GetState(); if (_keysCurrent.IsKeyDown(Keys.Q) && _keysLast.IsKeyUp(Keys.Q)) { _deviceState.Q = true; } if (_keysCurrent.IsKeyDown(Keys.Escape) && _keysLast.IsKeyUp(Keys.Escape)) { _deviceState.Q = true; } if (_keysCurrent.IsKeyDown(Keys.P) && _keysLast.IsKeyUp(Keys.P)) { _deviceState.P = true; } }