feat: move href logic to state mgr

This commit is contained in:
2026-06-02 03:57:42 -03:00
parent fd314cf2ec
commit 4120e5ec72
2 changed files with 8 additions and 3 deletions
@@ -70,7 +70,6 @@ export default function TheCreature() {
camera.position.y += (Math.random() - 0.5) * shakeIntensity;
if (globalDistance.current <= 0.1) {
window.location.href = '/';
fearState.registerCaught();
return;
}
+7 -1
View File
@@ -46,8 +46,14 @@ export const fearState = {
this.currentWidth = newWidth;
}
if (this.wasCaught && this.finaleProgression < FEAR_SETTINGS.EVENT_FINALE_DURATION)
if (this.wasCaught) {
if (this.finaleProgression < FEAR_SETTINGS.EVENT_FINALE_DURATION) {
this.finaleProgression = Math.min(this.finaleProgression + delta, FEAR_SETTINGS.EVENT_FINALE_DURATION);
} else {
window.location.href = '/';
}
}
this.emit();
},