mirror of
https://github.com/imjasonh/nescript
synced 2026-07-18 06:36:57 +00:00
examples/war: redesign card art — opaque bodies, 16x16 pips, checkerboard back
The first-pass card tiles were riddled with palette-0 transparent pixels that let the felt background bleed through every rank glyph, small suit, and big pip. At arm's length the cards looked like they had green specks eating them. This commit rewrites all of the card art from scratch: - **Opaque card bodies.** Every pixel inside a card tile is now either white (palette 2), red (1), or black (3). No `.` values anywhere on a face or back tile. The green felt only shows outside the card rectangle, where it should. - **Readable rank glyphs.** The 13 rank tiles (A, 2-9, 10, J, Q, K) are now drawn as bold black strokes on a solid white body. The "holes" of the letters (e.g. the triangle inside an "A") are white, not transparent. - **16x16 big pips.** The big centre pip is now a 4-tile (16x16) shape split into TL/TR/BL/BR quadrants per suit. Previously it was a 2-tile (16x8) half-height strip that looked cramped. The TL/TR quadrants kept their existing tile indices (28-35) so the shift is local; the new BL/BR quadrants are appended after the BIG WAR letters at tiles 88-95 to avoid renumbering the entire alphabet / digits / UI tile range. - **Distinct suit shapes.** Spade is a smooth teardrop with a short stem and base; heart is two symmetric lobes with a V bottom; diamond is a clean rhombus; club is three circles joined over a stem. Side-by-side they are unmistakable. - **Clean checkerboard card back.** The old card back was a diamond lattice that had the same transparent-bleed problem and looked noisy anyway. Replaced with a crisp 2-pixel black- and-white checkerboard that tiles seamlessly across the card back's 16x24 footprint. - **draw_card_face now emits 6 sprites in a rank/suit + 4-tile big-pip layout.** The previous 6-sprite layout was `[rank][ssuit] / [pipL][pipR] / [blankL][blankR]`; the new one is `[rank][ssuit] / [pipTL][pipTR] / [pipBL][pipBR]` with the bottom row carrying the bottom half of the big pip instead of being wasted blank tiles. Also: - New constants TILE_PIP_TL_BASE / TR / BL / BR replace the old TILE_PIP_L_BASE / TILE_PIP_R_BASE in constants.ne. - Refreshed war.nes and the goldens. Every emulator harness test still passes (31/31). https://claude.ai/code/session_0143dTgh3UeRrtfHgQwzcv5z
This commit is contained in:
parent
9137b1f713
commit
e10d09db76
6 changed files with 532 additions and 247 deletions
|
|
@ -59,9 +59,16 @@ const TILE_RANK_BASE: u8 = 11 // 13 tiles: A, 2..10, J, Q, K
|
|||
// Small suit glyphs for the card corner, one per suit.
|
||||
const TILE_SUIT_SMALL_BASE: u8 = 24 // 4 tiles: ♠ ♥ ♦ ♣
|
||||
|
||||
// Big centre-pip, authored as a 16×8 pair per suit (left half + right half).
|
||||
const TILE_PIP_L_BASE: u8 = 28 // 4 tiles
|
||||
const TILE_PIP_R_BASE: u8 = 32 // 4 tiles
|
||||
// Big centre-pip, authored as a 16×16 shape split into four 8×8
|
||||
// quadrants per suit. Each `_BASE + suit` picks the tile for that
|
||||
// suit's quadrant. The TL/TR quadrants are contiguous at 28-35;
|
||||
// the BL/BR quadrants live at 88-95 because they were added
|
||||
// after the alphabet / digit / BIG WAR tiles and putting them in
|
||||
// the middle would have shifted every later tile's index.
|
||||
const TILE_PIP_TL_BASE: u8 = 28 // spade/heart/diamond/club TL
|
||||
const TILE_PIP_TR_BASE: u8 = 32 // spade/heart/diamond/club TR
|
||||
const TILE_PIP_BL_BASE: u8 = 88 // spade/heart/diamond/club BL
|
||||
const TILE_PIP_BR_BASE: u8 = 92 // spade/heart/diamond/club BR
|
||||
|
||||
// Alphanumerics (8×8) used for all on-screen text that lives on the
|
||||
// sprite layer. Letters A-Z then digits 0-9, contiguous.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue