feat: sequencing

This commit is contained in:
math-pixel
2026-05-12 21:44:43 +02:00
parent ff79448ce8
commit 28c6ef199f
13 changed files with 110 additions and 155 deletions
+8 -1
View File
@@ -14,7 +14,10 @@ export function ZoneDetection(): null {
const triggeredZones = useRef<Set<string>>(new Set());
const debug = Debug.getInstance();
const step = useGameStore((state) => state.intro.currentStep);
const mainState = useGameStore((state) => state.mainState);
const setStep = useGameStore((state) => state.setIntroStep);
const setPyloneStep = useGameStore((state) => state.setPyloneState);
const advanceGameState = useGameStore((state) => state.advanceGameState);
useEffect(() => {
if (!debug.active) return;
@@ -65,7 +68,11 @@ export function ZoneDetection(): null {
const distanceSq = _playerPos.distanceToSquared(_zonePos);
if (distanceSq <= zone.radius * zone.radius) {
setStep(zone.targetStep);
if (zone.targetStep === "bike" && mainState === "intro") {
advanceGameState();
} else {
setStep(zone.targetStep);
}
triggeredZones.current.add(zone.id);
break;
}