diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b801cbc..6de3c2f 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -69,7 +69,7 @@ solitaire_quest/ │ ├── assets/ # Assets embedded at compile time via include_bytes!() │ ├── cards/ -│ │ ├── faces/face.png # placeholder (16×16 cream/ivory) +│ │ ├── faces/{rank}_{suit}.png # 52 individual card faces (120×168, generated by solitaire_assetgen) │ │ └── backs/back_0.png – back_4.png # placeholder patterns │ ├── backgrounds/bg_0.png – bg_4.png # placeholder textures │ ├── fonts/main.ttf # FiraMono-Medium (170K, OFL) @@ -292,8 +292,8 @@ struct SettingsResource(Settings); // Pre-loaded card face and back PNG handles struct CardImageSet { - face: Handle, // shared face image for all face-up cards - backs: [Handle; 5], // indexed by selected_card_back setting + faces: [[Handle; 13]; 4], // [suit][rank]: Clubs=0..Spades=3, Ace=0..King=12 + backs: [Handle; 5], // indexed by selected_card_back setting } // Project-wide font handle (FiraMono-Medium embedded at compile time) @@ -772,7 +772,7 @@ Audio systems listen for Bevy events and never block the game thread. ### Rendering approach -Cards are Bevy `Sprite` entities with `Handle` from `CardImageSet`. Face-up cards use `face.png` (a single shared image). Face-down cards use `backs/back_N.png` indexed by `settings.selected_card_back`. `Text2d` labels are still overlaid for rank and suit symbols. `CardImageSet` is populated at startup from `include_bytes!()` — no `AssetServer`. +Cards are Bevy `Sprite` entities with `Handle` from `CardImageSet`. Face-up cards use one of 52 individual face PNGs selected by `faces[suit][rank]` — rank and suit are baked into each image and no `Text2d` overlay is spawned. Face-down cards use `backs/back_N.png` indexed by `settings.selected_card_back`. `Text2d` labels are only used as a fallback when `CardImageSet` is absent (e.g. tests with `MinimalPlugins`). `CardImageSet` is populated at startup from `include_bytes!()` — no `AssetServer`. Backgrounds are Bevy `Sprite` entities with `Handle` from `BackgroundImageSet`. `BackgroundImageSet` is populated at startup from `include_bytes!()`. @@ -783,7 +783,7 @@ The `assets/` directory layout: ``` assets/ ├── cards/ -│ ├── faces/face.png # placeholder (16×16 cream/ivory) +│ ├── faces/{rank}_{suit}.png # 52 individual card faces (120×168, generated by solitaire_assetgen) │ └── backs/back_0.png – back_4.png # placeholder patterns ├── backgrounds/bg_0.png – bg_4.png # placeholder textures ├── fonts/main.ttf # FiraMono-Medium (170K, OFL) @@ -809,13 +809,6 @@ All sound effect WAV files are embedded at compile time via `include_bytes!()` i | `win_fanfare.wav` | Game won | | `ambient_loop.wav` | Looping background music | -### Future art pass - -The placeholder PNG files can be replaced with real artwork without any code changes — just drop in new PNGs and rebuild. The texture atlas approach described below is still the recommended upgrade path for card faces: -- Use a texture atlas (`assets/cards/atlas.png` + layout descriptor) for card faces -- Individual PNGs for card backs and backgrounds (5 each) -- All assets remain embedded via `include_bytes!()` to keep the binary self-contained - --- ## 15. Platform Targets