1
0

Updated the Game.jsx

This commit is contained in:
Mathias Wagner 2023-11-19 17:18:13 +01:00
parent 60c0a89ed7
commit d10b1ea8e9
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -6,12 +6,16 @@ import Waiting from "@/pages/Game/states/Waiting";
import Calculate from "@/pages/Game/states/Calculate";
import Sound from "react-sound";
import HintSound from "@/common/sounds/hint.mp3";
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
export const Game = () => {
const {groups} = useContext(GroupContext);
const [currentState, setCurrentState] = useState("hint");
const {musicEnabled} = useContext(MusicContext);
useEffect(() => {
const timeout = setTimeout(() => {
setCurrentState("waiting");
@ -25,7 +29,7 @@ export const Game = () => {
return (
<div className="game-page">
{currentState === "hint" && <>
<Sound url={HintSound} playStatus={Sound.status.PLAYING} volume={60} loop={false}/>
<Sound url={HintSound} playStatus={Sound.status.PLAYING} volume={musicEnabled ? 60 : 0} loop={false}/>
<h2 className="hint">
<span>Ziel</span>: Erhalte durch den Verkauf von Kuchen
so viel Gewinn wie möglich.