From 2c2feb0f884e4d76431acbb9adc666ce7cba9447 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Tue, 10 Dec 2019 11:22:42 -0500 Subject: [PATCH] fix turbosword issue GitOrigin-RevId: 57127fc84e9447f46ca27888546612c9cfbad58a --- Jumpy.Shared/Player.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jumpy.Shared/Player.cs b/Jumpy.Shared/Player.cs index 16480bb..0d1d7b8 100644 --- a/Jumpy.Shared/Player.cs +++ b/Jumpy.Shared/Player.cs @@ -37,12 +37,14 @@ namespace Jumpy { ySpeed = -jumpSpeed; 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; swordSwingTime = 0.3; return; } + Vector2 leftStick = gamePad[0].ThumbSticks.Left; if (gamePad[0].IsButtonDown(Buttons.DPadLeft) || leftStick.X < -0.5) { facing = Facing.Left;