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