From e6db79afbb922a236c16833e8459828ad1b30944 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Tue, 26 May 2026 19:50:53 -0600 Subject: [PATCH] feat(dominion): display opponent hand cards near portraits - Add face-down mini card sprites for opponents below their portraits - Implement layout logic to center and space cards based on hand size - Update card asset textures --- public/src/games/dominion/DominionGame.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public/src/games/dominion/DominionGame.js b/public/src/games/dominion/DominionGame.js index 39bff9b..a33eb39 100644 --- a/public/src/games/dominion/DominionGame.js +++ b/public/src/games/dominion/DominionGame.js @@ -355,6 +355,22 @@ export default class DominionGame extends Phaser.Scene { color: active ? COLORS.goldHex : COLORS.mutedHex, align: 'center', backgroundColor: 'rgba(0,0,0,0.55)', padding: { x: 8, y: 4 }, }).setOrigin(0.5).setDepth(D.hud)); + + // Mini face-down cards representing the opponent's hand + const OPP_W = 36, OPP_H = 52; + const handSize = p.hand.length; + if (handSize > 0) { + const gap = Math.min(4, (200 - handSize * OPP_W) / Math.max(1, handSize - 1)); + const step = OPP_W + Math.max(-OPP_W * 0.6, gap); + const totalW = (handSize - 1) * step + OPP_W; + const startX = s.x - totalW / 2 + OPP_W / 2; + const cardY = s.y + s.r + 75; + for (let j = 0; j < handSize; j++) { + const mini = this.buildCardFace(OPP_W, OPP_H, null, { faceDown: true }); + mini.setPosition(startX + j * step, cardY).setDepth(D.hud + j); + this.dynamicLayer.add(mini); + } + } }); }