feat(engine): add layout, LayoutResource, and TablePlugin

compute_layout is a pure function that maps window size to card size and
the 13 pile positions, with clamping at the 800x600 minimum and seven
tableau columns horizontally aligned with stock/waste (cols 0,1) and the
four foundations (cols 3,4,5,6). TablePlugin spawns a 2D camera, a felt
background sprite, and 13 translucent pile-marker sprites, and
repositions them on WindowResized. Plugin registers WindowResized
explicitly so it works under MinimalPlugins in tests.

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