Annex ยท match life cycle ๐ŸŽฎ
Annex

A match's life cycle

How a match is set up, played out and replayed โ€” on the phones and on the TV. Personas, views, state machine and reconnection, all through four hands-on simulators.

1Discovery โ€” the 4 views and the 2 personas

On every phone exactly one view is shown at a time, and the journey is always the same.

Four canonical views follow one another:

Two roles share the setup. The Architect (first to connect, or the loser on a rematch) configures the battlefield on page 1 and triggers the start by validating it. The Rival has no access to page 1, but can rush to page 2 and claim a side โ€” fastest wins. The match starts once page 1 is validated, a side is claimed, and both players are present.

When does the match start?

Tick the three conditions: the start only fires with all three met. Page 1 belongs to the Architect; the side, though, can be claimed by anyone.

2Intermediate โ€” the state machine

The displayed screen follows from a single current state. Walk the token through the machine: from each state, only the allowed transitions are offered. You find the cycle Lobby โ†’ Command โ†’ Cracktro, then โ€œReplayโ€ (back to the lobby) or โ€œQuitโ€ (back home).

State-machine walker

Tap a transition to advance. The phone screen (centre) always reflects the single current view.
Takeaway. A single field drives the display: it is impossible to show two views at once. That is the โ€œfreezingโ€ of the state machine.

3Expert โ€” reconnection & scenery continuity

On first connect, every device (player and TV) negotiates a unique token. If it loses the network, the server holds its place for 10 s: by reconnecting in time with its token, it reclaims exactly its seat. Beyond that the seat is freed โ€” and if it is the TV (the room's anchor) that vanishes, the whole match is closed.

10 s grace window

Slide the reconnect moment. Before 10 s: the seat is reclaimed. After: seat lost (player) or room destroyed (TV).

Another polished detail: the transition between rounds. The camera slides horizontally toward the next round, in parallax (the far scenery slides slower). The trap: when the camera resets, the scenery โ€œjumpsโ€ back. The fix is to bake the shift into the scenery so it keeps flowing seamlessly.

Scenery continuity (parallax)

With Bake: the world flows on, no jump. Without Bake: on the camera reset the scenery snaps back โ€” the bug we fix. The golden tower is the fixed reference.
For the curious. The sky doesn't move (factor 0), the mountains slide at 25โ€“45 %, the sun at 12 %. โ€œBakingโ€ means re-applying that offset after the camera reset: the parallax world then scrolls on continuously, round after round.

โ†ฉ Back home