public void Update(Camera camera, GameTime gameTime, ref IGameState gameState) { _serpents.UpdateScore(); if (_haltSerpents) { _serpents.FloatingTexts.Update(camera, gameTime); _serpents.PlayerCave.Update(camera, gameTime); } else _serpents.Update(camera, gameTime); _moveCamera.Move(gameTime); if (_todo.Do(gameTime)) return; _serpents.LivesLeft += _bonusLives; gameState = new GotoBoardState(_serpents, _serpents.Scene + 1); }
public void Update(Camera camera, GameTime gameTime, ref IGameState gameState) { addExplanationText(); if (_serpents.Camera.KeyboardState.IsKeyPressed(Keys.Q)) { _serpents.AddAndShowScore(5500, Vector3.Zero); _serpents.UpdateScore(); gameState = new HallOfameState(_serpents); return; } _freeCamera ^= _serpents.Camera.KeyboardState.IsKeyPressed(Keys.C); if(_freeCamera) _serpents.Camera.UpdateFreeFlyingCamera(gameTime); else if (!_cameraMovements.Do(gameTime)) addCameraActions(); _serpents.Update(camera, gameTime); _attractBigTexts.Update(gameTime); switch (_serpents.GameStatus()) { case Serpents.Result.PlayerDied: _serpents.PlayerSerpent.Restart(_serpents.PlayingField, 1); _serpents.PlayerSerpent.DirectionTaker = this; break; case Serpents.Result.LevelComplete: _serpents.Restart(_serpents.Scene); _serpents.PlayerSerpent.DirectionTaker = this; break; } if (_serpents.Camera.KeyboardState.IsKeyPressed(Keys.Space)) { _serpents.ResetScoreAndLives(); gameState = new GotoBoardState(_serpents, 0); } }