diff --git a/assets/js/mine-seeker/contexts/GameProvider.jsx b/assets/js/mine-seeker/contexts/GameProvider.jsx index 3874c8d..153d73f 100644 --- a/assets/js/mine-seeker/contexts/GameProvider.jsx +++ b/assets/js/mine-seeker/contexts/GameProvider.jsx @@ -49,6 +49,7 @@ export const GameProvider = ({ children }) => { mine: new Howl({ src: ['/sound/mine.mp3'] }), warning: new Howl({ src: ['/sound/warning.mp3'] }), won: new Howl({ src: ['/sound/won.mp3'] }), + starting: new Howl({ src: ['/sound/starting.mp3'] }), }); /** Sync helpers (keep ref + state in lockstep) */ @@ -269,6 +270,8 @@ export const GameProvider = ({ children }) => { makeGameEndIfItEnds, resignProcess, /** UI action */ onBombToggle, + /** Sounds */ + sounds, }} > {children} diff --git a/assets/js/mine-seeker/hooks/useServerCommunication.jsx b/assets/js/mine-seeker/hooks/useServerCommunication.jsx index 89dbcfa..2c1e187 100644 --- a/assets/js/mine-seeker/hooks/useServerCommunication.jsx +++ b/assets/js/mine-seeker/hooks/useServerCommunication.jsx @@ -22,7 +22,7 @@ const useServerCommunication = (gameAssoc, gameInherited, opponentName, isEnvDev /** Sync helpers */ syncWebPlayer, syncActivePlayer, syncBombSelected, syncConnLost, syncRed, syncBlue, /** Game logic */ - showOverlay, hideOverlay, applyStep, makeGameEndIfItEnds, resignProcess, + showOverlay, hideOverlay, applyStep, makeGameEndIfItEnds, resignProcess, sounds, /** Current cells snapshot (for active-check in onClick) */ cells, } = useGame(); @@ -212,6 +212,7 @@ const useServerCommunication = (gameAssoc, gameInherited, opponentName, isEnvDev */ if (!endRef.current && (!isTrueRestoredRef.current || 0 !== opponentLastSeenRef.current)) { hideOverlay(); + sounds.current.starting.play(); } }; diff --git a/public/sound/starting.mp3 b/public/sound/starting.mp3 new file mode 100644 index 0000000..2e9bc6d Binary files /dev/null and b/public/sound/starting.mp3 differ