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 void Update(float seconds, ComboChecker checker) { timer += seconds; bool hold = false; hold = UpdateActions(Light, checker) || hold; hold = UpdateActions(Heavy, checker) || hold; hold = UpdateActions(Special, checker) || hold; if (DashLs.Given) { if (!dashl) { dashl = true; dashr = false; timer = 0; } else { checker.AddAction(ComboAction.Dash); dashl = false; timer = 0; } } if (DashRs.Given) { if (!dashr) { dashr = true; dashl = false; timer = 0; } else { checker.AddAction(ComboAction.Dash); dashr = false; timer = 0; } } if (timer >= time_max) { dashl = false; dashr = false; } if (!hold && timer >= time_pause) { timer = tap_delay; checker.AddAction(ComboAction.Pause); } }
public override void Initialize(Game game) { checker = new ComboChecker(tree); }
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; }