feat: video intro

This commit is contained in:
math-pixel
2026-05-14 11:50:40 +02:00
parent 3ece1d76de
commit 5ee52ec752
+3 -1
View File
@@ -4,6 +4,7 @@ import { useGameStore } from "@/managers/stores/useGameStore";
export function GameFlow(): null {
const step = useGameStore((state) => state.intro.currentStep);
const setStep = useGameStore((state) => state.setIntroStep);
const playVideo = useGameStore((state) => state.playVideo);
const isCinematicPlaying = useGameStore((state) => state.isCinematicPlaying);
const sceneReady = useGameStore((state) => state.sceneReady);
const setCanMove = useGameStore((state) => state.setCanMove);
@@ -13,8 +14,9 @@ export function GameFlow(): null {
if (!hasInitialized.current && step === "intro" && sceneReady) {
hasInitialized.current = true;
setStep("sequence_video");
playVideo("/videos/intro.webm");
}
}, [step, setStep, sceneReady]);
}, [step, setStep, sceneReady, playVideo]);
useEffect(() => {
if (step === "sequence_video" && !isCinematicPlaying) {