private bool UpdateActions(PlayerInputAction a, ComboChecker checker) { if (a.Start.Given && timer >= tap_delay) { timer = 0; a.started = true; } if (a.started) { if (a.Finish.Given) { if (timer > time_hold) { checker.AddAction(a.Hold); } else { checker.AddAction(a.Tap); } a.started = false; timer = 0; } else if (timer > time_holdMax) { checker.AddAction(a.Hold); a.started = false; timer = 0; } return(true); } return(false); }
public PlayerInput() { Light = new PlayerInputAction(Command.KeyPr(Keys.A), Command.KeyRel(Keys.A), ComboAction.Light, ComboAction.Light_H); Heavy = new PlayerInputAction(Command.KeyPr(Keys.S), Command.KeyRel(Keys.S), ComboAction.Heavy, ComboAction.Heavy_H); Special = new PlayerInputAction(Command.KeyPr(Keys.W), Command.KeyRel(Keys.W), ComboAction.Special, ComboAction.Special_H); DashLs = Command.KeyPr(Keys.Left); DashRs = Command.KeyPr(Keys.Right); }
private bool UpdateActions(PlayerInputAction a, ComboChecker checker) { if (a.Start.Given && timer >= tap_delay) { timer = 0; a.started = true; } if (a.started) { if (a.Finish.Given) { if (timer > time_hold) checker.AddAction(a.Hold); else checker.AddAction(a.Tap); a.started = false; timer = 0; } else if (timer > time_holdMax) { checker.AddAction(a.Hold); a.started = false; timer = 0; } return true; } return false; }