slight tweak to sword-swinging code

GitOrigin-RevId: 042df7ea95bf77f029107c1a9363f3e1343bb928
This commit is contained in:
Colin McMillen 2019-12-08 14:26:43 -05:00
parent 6766e5ecf3
commit 576ac65eb7

View File

@ -38,6 +38,7 @@ namespace Jumpy {
ySpeed = -jumpSpeed;
return;
}
// TODO: only swing the sword if button newly pressed (no turbosword)
if (gamePad.Buttons.X == ButtonState.Pressed && swordSwingTime <= 0) {
pose = Pose.SwordSwing;
swordSwingTime = 0.3;
@ -106,11 +107,11 @@ namespace Jumpy {
}
case Pose.SwordSwing:
if (swordSwingTime > 0.2) {
return new Point(spriteSize * 3, 0);
return new Point(spriteSize * 3, spriteSize * 0);
} else if (swordSwingTime > 0.1) {
return new Point(spriteSize * 4, 0);
return new Point(spriteSize * 4, spriteSize * 0);
} else {
return new Point(spriteSize * 5, 0);
return new Point(spriteSize * 5, spriteSize * 0);
}
case Pose.Standing:
default: