1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55:38 +00:00
nescript/docs
Claude b83b944570
platformer: sprite-based status bar with score + lives
Upgrades the platformer's "live coin count" into a proper heads-up
display that stays pinned to the top of the viewport while the
nametable scrolls. Left side: coin icon + two-digit stomp tally.
Right side: red heart icon + single-digit lives counter. Both ride
through the GameOver screen without jumping position, so the death
banner reads as a continuation of the same run.

Wire-up: three new cross-state bits — score now accumulates across
lives, `lives` starts at 3 and decrements in `GameOver.on_enter`,
and the GameOver → Playing retry bounces to Title instead when the
last heart is spent (Title's `on_enter` refills both).

Tile pipeline: ten decimal digits + a heart glyph added to the
committed Tileset (generator source in `scripts/gen_platformer_tiles.rs`
kept in sync). Digits use `c` (white) so they read against the
sky; the heart uses `a` (red) to match the cap/brick palette.

Division workaround: the obvious `stomp_count / 10` / `% 10` pair
miscompiles near state transitions — the built ROM cycles
Title → Playing → Title once per blink period with Playing
surviving exactly one frame. Swapping both calls for repeated
`while r >= 10 { r -= 10 }` helpers fixes it. Documented as a
new entry in `docs/future-work.md` so the next person reaching
for `/` or `%` knows to check there first.

Goldens, docs/platformer.gif, and the top-level + examples README
entries all refreshed in the same commit.
2026-04-20 13:59:14 +00:00
..
architecture.md linker: add ca65-compatible --dbg output for source-level debugging 2026-04-16 22:39:08 +00:00
future-work.md platformer: sprite-based status bar with score + lives 2026-04-20 13:59:14 +00:00
language-guide.md docs + example: HUD demo and language-guide VRAM buffer section 2026-04-18 21:34:44 +00:00
nes-reference.md compiler: i16 / SRAM saves / inline-asm dot labels / docs 2026-04-18 20:49:06 +00:00
platformer.gif platformer: sprite-based status bar with score + lives 2026-04-20 13:59:14 +00:00
pong.gif codegen: fuse compare-then-branch to drop boolean materialization 2026-04-16 17:10:02 +00:00
war.gif examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00