protected override void InitializeInput() { var horizontalInput = new Multiple1DInputs(); var throwTrajectoryInput = new Multiple2DInputs(); var throwInput = new MultiplePressableInputs(); var jumpInput = new MultiplePressableInputs(); var fallThroughInput = new MultiplePressableInputs(); this.HorizontalInput = horizontalInput; this.ThrowTrajectoryInput = throwTrajectoryInput; this.ThrowInput = throwInput; this.JumpInput = jumpInput; this.FallThroughInput = fallThroughInput; if (InputManager.Xbox360GamePads[0].IsConnected) { jumpInput.Inputs.Add(InputManager.Xbox360GamePads[1].GetButton(FlatRedBall.Input.Xbox360GamePad.Button.A)); horizontalInput.Inputs.Add(InputManager.Xbox360GamePads[1].LeftStick.Horizontal); horizontalInput.Inputs.Add(InputManager.Xbox360GamePads[1].DPadHorizontal); fallThroughInput.Inputs.Add(InputManager.Xbox360GamePads[1].GetButton(Xbox360GamePad.Button.DPadDown)); } jumpInput.Inputs.Add(InputManager.Keyboard.GetKey(Keys.W)); horizontalInput.Inputs.Add(InputManager.Keyboard.Get1DInput(Keys.A, Keys.D)); fallThroughInput.Inputs.Add(InputManager.Keyboard.GetKey(Keys.S)); throwTrajectoryInput.Inputs.Add(InputManager.Keyboard.Get2DInput(Keys.J, Keys.L, Keys.I, Keys.K)); throwInput.Inputs.Add(InputManager.Keyboard.GetKey(Keys.E)); InputEnabled = true; }
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); }