Expand description
The Bevy shell: windowing, rendering, input, and the fixed-timestep bridge
into the headless simulation. Nothing in crate::sim may depend on this.
This file is the shell’s shared vocabulary: the resources, the states,
the messages. When each of them runs is [schedule]’s business.
Modules§
- layout
- Grid → world-space mapping. The board is centred on the origin; sim
ygrows downward (row 0 on top) while Bevy’s worldygrows upward. - net
- Online versus, shell side: a UDP lockstep session driving the same versus mode local play uses (spec §7.6 fallback path; see sim::net for why lockstep rather than GGRS rollback today).
- palette
- The game’s colours: the per-seat identity palette (with its colour-vision-safe alternative) and the shared UI inks.
Structs§
- Bots
- Which seats are bot-driven this round, and at what difficulty.
- Campaign
- Chrome
- Fixed interface a board must not slide under, in unscaled pixels.
- Daily
- The daily challenge: everyone in the world gets the same generated
arena for a given (UTC) day, thanks to determinism.
activewhile the current versus round is the daily. - Highlight
- Where the finished round’s highlight reel was written, so the results card can say so. Cleared when a round has no replay to build one from.
- Level
Saved - The editor wrote a level to disk. A message rather than a direct call so the editor need not know that anyone is keeping score.
- Load
Level - Rebuild the board from the campaign’s current level. With
keep_posts, signposts standing on the old board are re-placed: the fast retry loop. - Paused
- Pending
Actions - Player actions accumulated from input since the last fixed tick, in the
shape rollback netcode will feed. Taken (and reset) by
advance_simeach tick. - Placement
Denied - A player’s placement was rejected (occupied tile, rival post, or spent inventory): drives the denied sound and cursor flash.
- Playback
- A loaded replay being watched, and the next input index to feed.
- Recorder
- Records the running versus round for the replay file (spec §7.7).
- Resuming
- A round picked back up, from the save slot or from a pasted code,
waiting for
Screen::Versusto seat it. Taken byload_versus, which is the one place that decides what board a round starts from. - Round
Notice - What the menu has to say about the round you just put down, copied, or failed to. Shown in the menu’s status slot; a save that fails must not disappear in silence, since what it loses is the round you were playing.
- Sandbox
- Dev sandbox (
PINCH_SANDBOX=1): skips the menu straight into a versus arena with preloaded castle tiers. - Seat
Names - What each seat is called this round, resolved once at round load: online, the handshake’s agreed table (never the local couch names, which would label rivals with leftovers); offline, the settings names. Empty entries fall back to the localized seat label.
- Seats
- How many players a versus round seats (2-4). Drives castles, cursors, and HUD chips.
- Sim
- The authoritative simulation, wrapped for Bevy. Systems read it freely;
mutation happens in
advance_sim(ticks) and, during puzzle setup only, in the placement input system.
Enums§
- Campaign
Kind - Which level list the player is running.
- Phase
- Puzzle-mode round phases (spec §5.1: place, run, win or lose, retry).
- Screen
- Top-level mode select.
- Versus
Phase - Versus round flow: play until the tide, then results.
Functions§
- highlight_
path - Where that round’s highlight reel lands (see
crate::highlight). - replay_
path - Where the last finished versus round’s replay is written (spec §7.7).
- run
- seat_
label - The localized “P{n}” label for a seat, off-by-one included: seats count from 0, players from 1. The screens that talk about a seat with no name to consult (bindings, match setup) say it this way too.