Match Flow Kit: Countdowns, Rounds and Results
README.md
hill
The pure rules behind the Hill zone (king of the hill), with no engine calls, so they can be unit tested. Hill.component calls them every frame. A game or a test can use them directly.
LOOKS: the five looks in gallery order, each{ id, label, description }(glowRing,flagPlatform,scifiPad,runeCircle,outline).lookId(id)returns the canonical id, or nil. It ignores case and accepts a label, so"Sci-Fi Pad"gives"scifiPad".parseSpots(str)reads"x,z; x,y,z; EntityName"into{ {x, z, y?, name?} }. These are the extra spots: spot 1 is always the hill's own place.inside(px,py,pz, cx,cy,cz, radius, height)tests the capture cylinder: withinradiusacross the floor, from 0.5 below the centre up toheightabove it.spotIndex(info, moveEvery, nSpots)gives the 1-based spot frommatch:hillInfo(). While playing it isfloor(elapsed / moveEvery) % nSpots + 1; otherwise it is 1.untilMove(...)gives the seconds to the next move, ormath.huge.stateOf(info, localInsideIds)returns"idle" | "held" | "contested"and the holder (0 for none). It uses the match while a kingOfTheHill round is playing, and the local ids otherwise.COLORS,stateColor(state, mine, t, idle?)(contested pulses red to orange),flash(left, warnSeconds, t)(the blink before a move, getting faster) andparseColor("#rrggbb").