diff --git a/games/poker/poker.md b/games/poker/poker.md new file mode 100644 index 0000000..e2fcc45 --- /dev/null +++ b/games/poker/poker.md @@ -0,0 +1,137 @@ +# Poker + +A standard 52-card poker deck, laid out on a table with a draw pile and +community-card slots. Exercises the bgm loader's `$variants` expansion to +generate a full deck from a single part definition. + +```yaml file=poker.yaml +role: package +id: poker +title: Poker +designer: Public Domain +players: 9 +language: en +``` + +## Parts + +A single `card` part expanded into 52 cards by the `$variants` CSV. Each row +picks a cell from a `13×5` sprite sheet — 13 ranks across, 4 suits down, and +a shared card-back row at index 4. + +```yaml file=parts/cards.yaml +role: part +type: card +face: ./assets/cards.png +back: ./assets/cards.png +size: [63, 88, 3] +fillet: 2 +$variants: ./cards.csv +``` + +```csv file=parts/cards.csv +id,rank,suit,faceCrop,backCrop +string,string,string,[number;number;number;number],[number;number;number;number] +2s,2,spades,[0;0;13;5],[0;4;13;5] +3s,3,spades,[1;0;13;5],[0;4;13;5] +4s,4,spades,[2;0;13;5],[0;4;13;5] +5s,5,spades,[3;0;13;5],[0;4;13;5] +6s,6,spades,[4;0;13;5],[0;4;13;5] +7s,7,spades,[5;0;13;5],[0;4;13;5] +8s,8,spades,[6;0;13;5],[0;4;13;5] +9s,9,spades,[7;0;13;5],[0;4;13;5] +10s,10,spades,[8;0;13;5],[0;4;13;5] +js,J,spades,[9;0;13;5],[0;4;13;5] +qs,Q,spades,[10;0;13;5],[0;4;13;5] +ks,K,spades,[11;0;13;5],[0;4;13;5] +as,A,spades,[12;0;13;5],[0;4;13;5] +2h,2,hearts,[0;1;13;5],[0;4;13;5] +3h,3,hearts,[1;1;13;5],[0;4;13;5] +4h,4,hearts,[2;1;13;5],[0;4;13;5] +5h,5,hearts,[3;1;13;5],[0;4;13;5] +6h,6,hearts,[4;1;13;5],[0;4;13;5] +7h,7,hearts,[5;1;13;5],[0;4;13;5] +8h,8,hearts,[6;1;13;5],[0;4;13;5] +9h,9,hearts,[7;1;13;5],[0;4;13;5] +10h,10,hearts,[8;1;13;5],[0;4;13;5] +jh,J,hearts,[9;1;13;5],[0;4;13;5] +qh,Q,hearts,[10;1;13;5],[0;4;13;5] +kh,K,hearts,[11;1;13;5],[0;4;13;5] +ah,A,hearts,[12;1;13;5],[0;4;13;5] +2d,2,diamonds,[0;2;13;5],[0;4;13;5] +3d,3,diamonds,[1;2;13;5],[0;4;13;5] +4d,4,diamonds,[2;2;13;5],[0;4;13;5] +5d,5,diamonds,[3;2;13;5],[0;4;13;5] +6d,6,diamonds,[4;2;13;5],[0;4;13;5] +7d,7,diamonds,[5;2;13;5],[0;4;13;5] +8d,8,diamonds,[6;2;13;5],[0;4;13;5] +9d,9,diamonds,[7;2;13;5],[0;4;13;5] +10d,10,diamonds,[8;2;13;5],[0;4;13;5] +jd,J,diamonds,[9;2;13;5],[0;4;13;5] +qd,Q,diamonds,[10;2;13;5],[0;4;13;5] +kd,K,diamonds,[11;2;13;5],[0;4;13;5] +ad,A,diamonds,[12;2;13;5],[0;4;13;5] +2c,2,clubs,[0;3;13;5],[0;4;13;5] +3c,3,clubs,[1;3;13;5],[0;4;13;5] +4c,4,clubs,[2;3;13;5],[0;4;13;5] +5c,5,clubs,[3;3;13;5],[0;4;13;5] +6c,6,clubs,[4;3;13;5],[0;4;13;5] +7c,7,clubs,[5;3;13;5],[0;4;13;5] +8c,8,clubs,[6;3;13;5],[0;4;13;5] +9c,9,clubs,[7;3;13;5],[0;4;13;5] +10c,10,clubs,[8;3;13;5],[0;4;13;5] +jc,J,clubs,[9;3;13;5],[0;4;13;5] +qc,Q,clubs,[10;3;13;5],[0;4;13;5] +kc,K,clubs,[11;3;13;5],[0;4;13;5] +ac,A,clubs,[12;3;13;5],[0;4;13;5] +``` + +## Board + +A table with a draw pile on the left and five community-card slots across the +middle. The deck pile fans its stacked cards along a curve. + +```yaml file=parts/board.yaml +type: board +id: poker +role: surface +size: [600, 400] +layout: + - route: /deck + x: -250 + y: 0 + rotation: 0 + stacking: + curve: M 0 0 C 20 -20 40 -20 60 0 + limit: 0 + align: center + - route: /community/:slot + candidates: + $variants: ./community.csv +``` + +```csv file=parts/community.csv +slot,x,y,rotation +string,number,number,number +0,-100,0,0 +1,-50,0,0 +2,0,0,0 +3,50,0,0 +4,100,0,0 +``` + +## Setup + +Deal the whole deck onto the draw pile (`poker:card` expands to every card of +that type), then flip a flop onto the community slots. + +```yaml file=setup/main.yaml +role: setup +type: game +id: main +setup: + /deck: poker:card + /community/0: poker:card#as + /community/1: poker:card#kh + /community/2: poker:card#7d +``` \ No newline at end of file