Log inGet started
World

Match Flow Kit: Countdowns, Rounds and Results

README.md

rules

The match state machine for all eight formats, as pure Luau with no engine calls. MatchFlow runs it on the machine in charge, and the test suite drives it directly.

  • config(t) fills defaults and clamps; newState() returns an empty match.
  • step(state, cfg, dt) moves through waiting → lobby → countdown → playing → results → intermission and returns events (phase, roundEnd, matchEnd, turn, wave).
  • Reports: score, setScore, knockOut, finish, clearWave, endTurn and setOnHill. Roster: addPlayer and removePlayer. Control: forceStart and reset.
  • standings(state, cfg) returns rows ordered by the format's ranking, with shared places for ties.
  • advanceClock moves only the clock, for machines between snapshots. formatClock(seconds) gives m:ss.
  • cfg.grace (default 0) keeps a timed round open that many seconds after 0:00. inPlayAt(state, at) says whether a report made at seconds into the round falls between GO and 0:00. finish(state, cfg, id, at?) records the finish time as at when it is given. MatchFlow uses all three to judge reports by the time on the reporter's screen.

Use it directly to run a match in your own component, or to simulate one in a test.