Split card design into front+back, add sound effects & background music
Card design: - Separate cardFront + cardBack (each own/equip independently) - Fronts: classic (free), ivory/rosegold (buy), parchment/mint (earned) - Backs: classic (free), sapphire/emerald (buy), ruby/royal (earned) - PlayingCard `front` prop; table applies front to all faces, back to opponents - Profile has front + back pickers; shop has both sections Audio: - Web Audio synth engine (no asset files): SFX for card/deal/trump/trick, win/lose, message, notify, award, levelup, purchase, kot + ambient music - Toggles in profile (Audio) + mute button in game HUD; prefs persisted - Wired across game-store, rewards, daily, shop, chat Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { create } from "zustand";
|
||||
import { sound } from "./sound";
|
||||
|
||||
interface SoundStore {
|
||||
sfx: boolean;
|
||||
music: boolean;
|
||||
toggleSfx: () => void;
|
||||
toggleMusic: () => void;
|
||||
}
|
||||
|
||||
export const useSoundStore = create<SoundStore>((set, get) => ({
|
||||
sfx: sound.sfxEnabled,
|
||||
music: sound.musicEnabled,
|
||||
toggleSfx: () => {
|
||||
const v = !get().sfx;
|
||||
sound.setSfxEnabled(v);
|
||||
set({ sfx: v });
|
||||
},
|
||||
toggleMusic: () => {
|
||||
const v = !get().music;
|
||||
sound.setMusicEnabled(v);
|
||||
set({ music: v });
|
||||
},
|
||||
}));
|
||||
Reference in New Issue
Block a user