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
This commit is contained in:
Brian Fertig 2026-06-09 21:32:31 -06:00
parent 082007ac81
commit 39e925016e
1 changed files with 7 additions and 4 deletions

View File

@ -754,14 +754,17 @@ export default class BlackjackGame extends Phaser.Scene {
} }
animateDeal(onComplete) { animateDeal(onComplete) {
// Deal in play order (top-right, clockwise): each player card 1, dealer upcard, // Deal order: dealer hole card (face-down), each player card 1,
// each player card 2, dealer hole. // dealer upcard (face-up), each player card 2.
const seats = PLAY_ORDER.filter(seat => this.gs.players[seat]?.active); const seats = PLAY_ORDER.filter(seat => this.gs.players[seat]?.active);
const dealSeq = []; 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 }); 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 }); 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 // Hide all cards initially
for (const cards of Object.values(this.cardGraphics)) { for (const cards of Object.values(this.cardGraphics)) {