From 39e925016efa743c42a1a289b1f3cf2976c97d33 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Tue, 9 Jun 2026 21:32:31 -0600 Subject: [PATCH] fix: correct blackjack card dealing animation order - Change deal sequence to match real blackjack rules: dealer hole card face-down first, then player cards, dealer upcard face-up, then second player cards - Add renderAll() call to ensure card graphics exist before animation - Update comments to reflect new deal order --- public/src/games/blackjack/BlackjackGame.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/src/games/blackjack/BlackjackGame.js b/public/src/games/blackjack/BlackjackGame.js index bb7e127..ae41fa0 100644 --- a/public/src/games/blackjack/BlackjackGame.js +++ b/public/src/games/blackjack/BlackjackGame.js @@ -754,14 +754,17 @@ export default class BlackjackGame extends Phaser.Scene { } animateDeal(onComplete) { - // Deal in play order (top-right, clockwise): each player card 1, dealer upcard, - // each player card 2, dealer hole. + // Deal order: dealer hole card (face-down), each player card 1, + // dealer upcard (face-up), each player card 2. const seats = PLAY_ORDER.filter(seat => this.gs.players[seat]?.active); const dealSeq = []; + dealSeq.push({ type: 'dealer', cardIdx: 1 }); // hole card face-down first for (const seat of seats) dealSeq.push({ type: 'player', seat, cardIdx: 0 }); - dealSeq.push({ type: 'dealer', cardIdx: 0 }); // upcard + dealSeq.push({ type: 'dealer', cardIdx: 0 }); // upcard face-up for (const seat of seats) dealSeq.push({ type: 'player', seat, cardIdx: 1 }); - dealSeq.push({ type: 'dealer', cardIdx: 1 }); // hole card + + // Build card graphics now (hands are populated but graphics weren't created yet) + this.renderAll(); // Hide all cards initially for (const cards of Object.values(this.cardGraphics)) {