コード例 #1
0
ファイル: GameView.cs プロジェクト: theboot999/Bushfire
        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);
            }
        }
コード例 #2
0
ファイル: GameScreen.cs プロジェクト: theboot999/Bushfire
        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);
            }
        }