diff --git a/src/modules/game/assets/begin.mp3 b/src/modules/game/assets/begin.mp3 new file mode 100644 index 0000000..c655f13 Binary files /dev/null and b/src/modules/game/assets/begin.mp3 differ diff --git a/src/modules/game/assets/good_guys_win.mp3 b/src/modules/game/assets/good_guys_win.mp3 new file mode 100644 index 0000000..8ff3ca4 Binary files /dev/null and b/src/modules/game/assets/good_guys_win.mp3 differ diff --git a/src/modules/game/components/Game/Game.tsx b/src/modules/game/components/Game/Game.tsx index 775caf1..50cb594 100644 --- a/src/modules/game/components/Game/Game.tsx +++ b/src/modules/game/components/Game/Game.tsx @@ -5,6 +5,8 @@ import { useParams } from 'react-router-dom'; import { abi } from '../../../../abi/cipherbomb.json'; import { getEventContract, getReadContract, onNextBlock } from '../../../../utils/rpc'; import { Splash } from '../../../common-ui/components/Splash'; +import begin from '../../assets/begin.mp3'; +import goodGuysWin from '../../assets/good_guys_win.mp3'; import { Table } from '../Table'; import { WaitingRoom } from '../WaitingRoom'; @@ -92,13 +94,17 @@ export const Game = ({ account, provider }: GameProps) => { useEffect(() => { const gameHasStarted = () => { - onNextBlock(() => setGameIsRunning(true)); + onNextBlock(() => { + void new Audio(begin).play(); + setGameIsRunning(true); + }); }; const gameHasBeenOpen = () => { onNextBlock(refreshInformations); }; const onGoodGuysWin = () => { + void new Audio(goodGuysWin).play(); setEndGame('good'); onNextBlock(refreshInformations); onNextBlock(refreshPlayers);