1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 00:45:38 +00:00

docs: add docs/war.gif demo to README

Captures the first ~6 s of examples/war.ne via the same
puppeteer + jsnes + gifenc pipeline that powers
docs/platformer.gif: title menu thumbnail, 52-card deal
animation, and a few rounds of CPU vs CPU play. Embedded
in the top-level README right under the platformer demo.

record_gif.mjs gains a 6th positional arg for the warmup
override (defaulting to the existing WARMUP env / 30) so
the war command can keep its title menu as the first frame
while platformer keeps skipping past its own title. The
CI emulator job and the pre-commit hook both rebuild the
gif into a tmp path and fail-with-fix-command if the
committed copy is stale; the war trigger covers war.ne,
war.nes, any examples/war/*.ne include, plus the recorder
and harness.
This commit is contained in:
Claude 2026-04-16 00:37:23 +00:00
parent add0df6ff1
commit 318a2f8bef
No known key found for this signature in database
6 changed files with 107 additions and 41 deletions

View file

@ -22,22 +22,28 @@ re-derive the project conventions from scratch.
tmp path and fails if the committed version differs, pointing at
the exact `cargo run -- build examples/<name>.ne` to run. The
pre-commit hook under `scripts/pre-commit` catches this locally.
- **`docs/platformer.gif` is committed** and embedded in the
top-level README as the project demo. `gifenc` + `jsnes` are
deterministic, so the gif's bytes are a function of the compiler,
the runtime, the harness, and `examples/platformer.ne`. Any change
to those that affects the first ~6 seconds of observable platformer
gameplay must be followed by regenerating the gif:
- **`docs/platformer.gif` and `docs/war.gif` are committed** and
embedded in the top-level README as the project demos. `gifenc` +
`jsnes` are deterministic, so each gif's bytes are a function of
the compiler, the runtime, the harness, and the underlying `.ne`
source(s). Any change to those that affects the first ~6 seconds
of observable gameplay must be followed by regenerating the
affected gif:
```bash
node tests/emulator/record_gif.mjs platformer 360 2 docs/platformer.gif
node tests/emulator/record_gif.mjs war 360 2 docs/war.gif 4
```
and committing it in the same change. CI's `emulator` job renders
a fresh gif and fails if the committed one doesn't byte-match. The
pre-commit hook rebuilds the gif when `platformer.ne`, `platformer.nes`,
`record_gif.mjs`, or `harness.html` is staged (and `tests/emulator/node_modules`
is installed).
(The trailing `4` on the war command is the warmup-frames
override — war's title menu is the gif thumbnail, so we don't
skip past it the way the platformer recording does.) Commit the
regenerated gif in the same change. CI's `emulator` job renders
fresh gifs and fails if either committed copy doesn't byte-match.
The pre-commit hook rebuilds whichever gif is affected when
`platformer.ne`, `platformer.nes`, any file under `examples/war/`,
`war.ne`, `war.nes`, `record_gif.mjs`, or `harness.html` is
staged (and `tests/emulator/node_modules` is installed).
- `docs/future-work.md` lists the remaining gaps. If you implement
something from that file, update the doc in the same PR.