1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55: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

@ -161,6 +161,21 @@ jobs:
echo "::error file=docs/platformer.gif::committed docs/platformer.gif is stale; rerun \`node tests/emulator/record_gif.mjs platformer 360 2 docs/platformer.gif\` and commit the new gif"
exit 1
fi
- name: Verify docs/war.gif is up to date
# Same contract as docs/platformer.gif: the README embeds
# docs/war.gif as the second project demo, gifenc + jsnes are
# deterministic, so any change to the compiler / runtime /
# harness / war source that affects the first ~6 seconds of
# the war.ne gameplay must be followed by regenerating the
# gif. The 5th positional arg (`4`) is the warmup; war's
# title menu is the gif thumbnail so we don't skip past it.
working-directory: tests/emulator
run: |
node record_gif.mjs war 360 2 /tmp/war.gif 4
if ! cmp -s ../../docs/war.gif /tmp/war.gif; then
echo "::error file=docs/war.gif::committed docs/war.gif is stale; rerun \`node tests/emulator/record_gif.mjs war 360 2 docs/war.gif 4\` and commit the new gif"
exit 1
fi
- name: Upload actual + diff PNGs on failure
if: failure()
uses: actions/upload-artifact@v4