public override void Update(Input input) { if (GameController.inGameState == InGameState.RUNNING) { base.Update(input); camera.viewport = containerCamera.worldCameraViewport; //in case there as a resize etc camera.Update(input, hasCameraFocus); camera.UpdateDrawPoints(GroundLayerController.tileSize, world.worldWidth, world.worldHeight); if (DisplayController.showDebugWindowTwo) { UpdateDebug(input); } if (input.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Y)) { WorldController.time = 10f; } if (input.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.U)) { WorldController.time = 20f; } if (input.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.C)) { WorldController.AddDebugMessage(new Point(WorldController.mouseTileHover.X, WorldController.mouseTileHover.Y)); } UpdateMouseClicks(input); } }
private void UpdateKeys(Input input) { if (input.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Escape) && GameController.inGameState != InGameState.INMENU) { AddContainer(new MenuBarInGame()); } if (input.IsKeyMapPressed(KeyMap.IncreaseGameSpeed)) { if (input.IsKeyMapDown(KeyMap.FastMovingCamera)) { EngineController.timeMultiply += 10f; } else { EngineController.timeMultiply += 0.1f; } EngineController.timeMultiply = MathHelper.Clamp(EngineController.timeMultiply, 0, 101); } if (input.IsKeyMapPressed(KeyMap.DecreaseGameSpeed)) { if (input.IsKeyMapDown(KeyMap.FastMovingCamera)) { EngineController.timeMultiply -= 10f; } else { EngineController.timeMultiply -= 0.1f; } EngineController.timeMultiply = MathHelper.Clamp(EngineController.timeMultiply, 0, 101); } if (input.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.H)) { WorldController.AddDebugMessage(WorldController.mouseTileHover); } }