// Sound effect keys — must match the keys loaded in PreloadScene. export const SFX = { CARD_DEAL: 'sfx-card-deal', CARD_PLACE: 'sfx-card-place', CARD_SHOW: 'sfx-card-show', CARD_SHUFFLE: 'sfx-card-shuffle', CASINO_BLACKJACK: 'sfx-casino-blackjack', CASINO_LOSE: 'sfx-casino-lose', CASINO_WIN: 'sfx-casino-win', CHIP_BET: 'sfx-chip-bet', DICE_ROLL: 'sfx-dice-roll', PENCIL_WRITE: 'sfx-pencil-write', PIECE_CLICK: 'sfx-piece-click', ROULETTE: 'sfx-roulette', }; export function playSound(scene, key) { try { scene.sound.play(key); } catch (_) {} } // chip-bet is limited to one simultaneous instance. let _chipBetSound = null; export function playChipBet(scene) { if (_chipBetSound?.isPlaying) return; _chipBetSound?.destroy(); _chipBetSound = scene.sound.add(SFX.CHIP_BET); _chipBetSound.play(); }