# Design This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold. ## Movement fixtures Arena 1200, wrap on, tick 60. Ship starts at (600, 600), heading 0 (to the right), velocity 0. | Input | Duration (s) | End position (x, y) | End heading | End speed | | --- | --- | --- | --- | --- | The machine-checked movement table is `fixtures/dogfight-move.json`. Tests compare to that file, not to a re-typed row. Positions are within 0.5 px, headings within 0.2 degrees, speeds within 0.5 units/s. ## Hit fixtures (authoritative, lag-free) A near-miss and a hit are listed in `fixtures/dogfight-hits.json`. A hit is a swept test: if the shot's segment this step comes within 19 px of the ship's centre, it hits (16 + 3). ## Scripted two-client round `fixtures/dogfight-round.json` lists, for 12 seconds at tick 60, each client's thrust, turn and fire. Expected: at t = 4.2 s a hit, score 1–0, lives 5 and 4; at t = 5.7 s the hit ship is on pad 1 at (80, 80) if that is the next pad. The file is the authority. ## Screenshot times | File | t (s) | | --- | --- | | spawn | 0 | | mid-fight | 2.5 | | hit | 4.2 | | respawn | 5.7 | Tolerance: 8 levels, 98% of pixels. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `arena` | Arena size, px | 1200 | Width and height of the square arena, from 800 to 2000. | | `lives` | Lives per round | 5 | A whole number from 1 to 9. | | `wrap` | Wrap at edges | on | A ship leaving one edge appears on the opposite edge. | | `friendly_fire` | Friendly fire | off | In a team mode later; in the default free-for-all this option is ignored. | | `tick` | Tick rate | 60 | Simulation steps a second. Tests run at both. | ## Acceptance at the defaults The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins. | Fixture | Role | | --- | --- | | `fixtures/dogfight-hits.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/dogfight-move.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/dogfight-round.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy. ## Screenshots These pictures are headless-Chrome captures of the working reference in `reference/preview.html`, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel. | File | What it shows | | --- | --- | | `shots/arena.png` | Two ships exchanging missiles in the 1200 arena, score 4–3. | ## How to verify 1. Run the checks at the default inputs, without a network. 2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file. 3. Repeat once at the person's inputs when they differ from the defaults. 4. Local two-client tests, with an in-process server and a virtual clock, cover movement, shots, scoring and respawn. Hit detection is a lag-independent swept test and is checked at both tick rates. No live network is required. Four golden frames are taken from the scripted round.