fix turbosword issue

GitOrigin-RevId: 57127fc84e9447f46ca27888546612c9cfbad58a
This commit is contained in:
Colin McMillen 2019-12-10 11:22:42 -05:00
parent 3589a3660f
commit 2c2feb0f88

View File

@ -37,12 +37,14 @@ namespace Jumpy {
ySpeed = -jumpSpeed; ySpeed = -jumpSpeed;
return; return;
} }
// TODO: only swing the sword if button newly pressed (no turbosword)
if (gamePad[0].IsButtonDown(Buttons.X) && swordSwingTime <= 0) { if (gamePad[0].IsButtonDown(Buttons.X) && gamePad[1].IsButtonUp(Buttons.X)
&& swordSwingTime <= 0) {
pose = Pose.SwordSwing; pose = Pose.SwordSwing;
swordSwingTime = 0.3; swordSwingTime = 0.3;
return; return;
} }
Vector2 leftStick = gamePad[0].ThumbSticks.Left; Vector2 leftStick = gamePad[0].ThumbSticks.Left;
if (gamePad[0].IsButtonDown(Buttons.DPadLeft) || leftStick.X < -0.5) { if (gamePad[0].IsButtonDown(Buttons.DPadLeft) || leftStick.X < -0.5) {
facing = Facing.Left; facing = Facing.Left;