feat(gofish): reveal drawn card to local player during go-fish

When the local player picks a card from the scattered pool, the card is now flipped face-up in place for 700ms before flying to their hand. This provides visual feedback on the drawn card. AI draws remain hidden and fly directly to the hand.
This commit is contained in:
Brian Fertig 2026-05-18 23:31:45 -06:00
parent 4364181041
commit 55ff4a3e00
1 changed files with 24 additions and 12 deletions

View File

@ -980,25 +980,37 @@ export default class GoFishGame extends Phaser.Scene {
}; };
if (sprite) { if (sprite) {
this.animateFishDraw(sprite, askerSeat, continueAfterDraw); const revealCard = askerSeat === 0 ? after.lastAsk.drawnCard : null;
this.animateFishDraw(sprite, askerSeat, revealCard, continueAfterDraw);
} else { } else {
this.time.delayedCall(50, continueAfterDraw); this.time.delayedCall(50, continueAfterDraw);
} }
} }
animateFishDraw(sprite, askerSeat, onComplete) { animateFishDraw(sprite, askerSeat, revealCard, onComplete) {
const layout = slotLayout(this.slotForSeat[askerSeat]); const layout = slotLayout(this.slotForSeat[askerSeat]);
sprite.setDepth(D.banner - 4); sprite.setDepth(D.banner - 4);
this.tweens.add({
targets: sprite, const flyToHand = () => {
x: layout.handCenter.x, y: layout.handCenter.y, this.tweens.add({
rotation: 0, targets: sprite,
alpha: 0, x: layout.handCenter.x, y: layout.handCenter.y,
duration: 400, rotation: 0,
ease: 'Cubic.easeIn', alpha: 0,
onComplete: () => { if (sprite.active) sprite.destroy(); }, duration: 400,
}); ease: 'Cubic.easeIn',
this.time.delayedCall(450, onComplete); onComplete: () => { if (sprite.active) sprite.destroy(); },
});
this.time.delayedCall(450, onComplete);
};
if (revealCard) {
// Human pick: flip face-up in place, pause to show the card, then fly to hand.
this.flipCardFaceUp(sprite, revealCard);
this.time.delayedCall(700, flyToHand);
} else {
flyToHand();
}
} }
formatAskBanner(last) { formatAskBanner(last) {