Exemple #1
0
        private void PerformLightLogic()
        {
            if (this.LightToggleInput.WasJustPressed)
            {
                this.LightBeamInstance.Visible = !this.LightBeamInstance.Visible;
            }

            if (this.LightBeamInstance.Visible)
            {
                LightInput.Activity();

                var angle = LightInput.GetAngle();

                if (angle != null)
                {
                    this.LightBeamInstance.RelativeRotationZ = angle.Value;
                }
            }
        }
Exemple #2
0
        private void AssignInput()
        {
            var movementInput = new Multiple2DInputs();

            movementInput.Inputs.Add(InputManager.Keyboard.Get2DInput(
                                         Microsoft.Xna.Framework.Input.Keys.A,
                                         Microsoft.Xna.Framework.Input.Keys.D,
                                         Microsoft.Xna.Framework.Input.Keys.W,
                                         Microsoft.Xna.Framework.Input.Keys.S));
            movementInput.Inputs.Add(InputManager.Xbox360GamePads[0].LeftStick);
            MovementInput = movementInput;

            var dashInput = new MultiplePressableInputs();

            dashInput.Inputs.Add(InputManager.Keyboard.GetKey(Microsoft.Xna.Framework.Input.Keys.E));
            dashInput.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.B));
            DashInput = dashInput;

            var dialogInput = new MultiplePressableInputs();

            dialogInput.Inputs.Add(InputManager.Keyboard.GetKey(Microsoft.Xna.Framework.Input.Keys.Space));
            dashInput.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.X));
            DialogInput = dialogInput;

            var actionInput = new MultiplePressableInputs();

            actionInput.Inputs.Add(InputManager.Keyboard.GetKey(Microsoft.Xna.Framework.Input.Keys.Space));
            actionInput.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.A));
            ActionInput = actionInput;

            var lightToggleInput = new MultiplePressableInputs();

            lightToggleInput.Inputs.Add(InputManager.Mouse.GetButton(Mouse.MouseButtons.RightButton));
            lightToggleInput.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.RightShoulder));
            LightToggleInput = lightToggleInput;

            LightInput = new LightInput(this);
        }