diff --git a/public/src/games/paigow/PaiGowPokerGame.js b/public/src/games/paigow/PaiGowPokerGame.js index 5c0f8de..f8432d0 100644 --- a/public/src/games/paigow/PaiGowPokerGame.js +++ b/public/src/games/paigow/PaiGowPokerGame.js @@ -426,14 +426,39 @@ export default class PaiGowPokerGame extends Phaser.Scene { showHandSetPanel() { this.panelVisible = true; + this.animating = true; for (const o of this.setPanelGroup) o.setVisible(true); - // Hide all portraits and their seat labels so they don't overlap the panel for (const p of this.portraits) p?.hide?.(); for (const t of Object.values(this.nameTxts)) t.setVisible(false); for (const t of Object.values(this.chipTxts)) t.setVisible(false); - // Build and place the 7 card containers in the source area - this.buildSetCardContainers(); - this.updateHandSetUI(); + + // Grab the face-up seat cards that were just dealt + const seatCards = [...(this.seatCardGraphics[0] ?? [])]; + + const onAllArrived = () => { + // Swap animated seat cards for interactive panel cards + for (const c of seatCards) c.destroy(); + this.seatCardGraphics[0] = []; + this.buildSetCardContainers(); + this.updateHandSetUI(); + this.animating = false; + }; + + if (!seatCards.length) { onAllArrived(); return; } + + let done = 0; + seatCards.forEach((cont, i) => { + cont.setDepth(D.panel + 10); + this.tweens.add({ + targets: cont, + x: this.sourceCardX(i), + y: SOURCE_Y, + duration: 380, + delay: i * 65, + ease: 'Back.easeOut', + onComplete: () => { if (++done === seatCards.length) onAllArrived(); }, + }); + }); } hideHandSetPanel() {