Banked Animation for Kiitos

This commit is contained in:
Brian Fertig 2026-06-07 12:15:10 -06:00
parent f3939435c6
commit 27635d166f
1 changed files with 22 additions and 15 deletions

View File

@ -488,7 +488,7 @@ export default class KiitosGame extends Phaser.Scene {
this.kiitosBubble(owner, evt.word);
}
if (evt?.roundOver) { this.time.delayedCall(700, () => this.endRound()); return; }
this.time.delayedCall(evt?.completed ? 1100 : 360, () => this.nextTurn());
this.time.delayedCall(evt?.completed ? 2800 : 360, () => this.nextTurn());
}
// ── Human turn (drag & drop) ──────────────────────────────────────────────────
@ -764,21 +764,28 @@ export default class KiitosGame extends Phaser.Scene {
// ── Effects ─────────────────────────────────────────────────────────────────
kiitosBubble(owner, word) {
playSound(this, SFX.VICTORY_SHORT);
const cx = GAME_WIDTH / 2, cy = CENTER_Y;
const cx = GAME_WIDTH / 2, cy = GAME_HEIGHT / 2;
const msg = `${owner.name === 'You' ? 'You' : owner.name} banks "${word}"`;
const cont = this.add.container(cx, cy).setDepth(D.bubble);
const g = this.add.graphics();
g.fillStyle(0xffffff, 0.97); g.fillRoundedRect(-220, -70, 440, 140, 22);
g.lineStyle(4, THEME.accent, 1); g.strokeRoundedRect(-220, -70, 440, 140, 22);
cont.add(g);
cont.add(this.add.text(0, -26, 'Kiitos!', {
fontFamily: 'YummyCupcakes', fontSize: '52px', color: THEME.accentHex,
}).setOrigin(0.5));
cont.add(this.add.text(0, 28, `${owner.name === 'You' ? 'You' : owner.name} banked "${word}"`, {
fontFamily: 'Righteous', fontSize: '24px', color: THEME.inkHex,
}).setOrigin(0.5));
cont.setScale(0.2);
this.tweens.add({ targets: cont, scale: 1, duration: 280, ease: 'Back.easeOut' });
this.tweens.add({ targets: cont, alpha: 0, delay: 900, duration: 300, onComplete: () => cont.destroy() });
const bg = this.add.graphics();
const tw = this.add.text(0, 0, msg, {
fontFamily: 'Righteous', fontSize: '72px', color: '#f0b830',
}).setOrigin(0.5);
const bw = tw.width + 60, bh = tw.height + 40;
bg.fillStyle(0x000000, 0.6);
bg.fillRoundedRect(-bw / 2, -bh / 2, bw, bh, 20);
cont.add(bg);
cont.add(tw);
this.time.delayedCall(1200, () => {
this.tweens.add({
targets: cont,
scale: 0.5,
alpha: 0,
duration: 400,
ease: 'Cubic.easeIn',
onComplete: () => cont.destroy(),
});
});
}
flashCenter(msg, colorHex) {