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:
parent
4364181041
commit
55ff4a3e00
|
|
@ -980,15 +980,18 @@ 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);
|
||||||
|
|
||||||
|
const flyToHand = () => {
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: sprite,
|
targets: sprite,
|
||||||
x: layout.handCenter.x, y: layout.handCenter.y,
|
x: layout.handCenter.x, y: layout.handCenter.y,
|
||||||
|
|
@ -999,6 +1002,15 @@ export default class GoFishGame extends Phaser.Scene {
|
||||||
onComplete: () => { if (sprite.active) sprite.destroy(); },
|
onComplete: () => { if (sprite.active) sprite.destroy(); },
|
||||||
});
|
});
|
||||||
this.time.delayedCall(450, onComplete);
|
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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue