feat(engine): add CardPlugin with procedural card rendering

Each card is a parent Sprite (white for face-up, blue for face-down) with
a Text2d child showing rank+suit (e.g. "AH", "10C", "KS"). Hearts and
diamonds render red; clubs and spades black. Face-down labels are hidden.
Tableau cards fan downward; other piles stack at the same position with a
small z-offset.

Sync runs in PostStartup for the initial deal and in Update after every
StateChangedEvent. To avoid a one-frame lag, downstream plugins run after
the new GameMutation system set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-04-23 16:22:49 -07:00
parent d92b4a8648
commit 0a87f0f8f2
4 changed files with 446 additions and 3 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
use bevy::prelude::*;
use solitaire_engine::{GamePlugin, TablePlugin};
use solitaire_engine::{CardPlugin, GamePlugin, TablePlugin};
fn main() {
App::new()
@@ -15,5 +15,6 @@ fn main() {
)
.add_plugins(GamePlugin)
.add_plugins(TablePlugin)
.add_plugins(CardPlugin)
.run();
}