feat: move href logic to state mgr
This commit is contained in:
@@ -70,7 +70,6 @@ export default function TheCreature() {
|
|||||||
camera.position.y += (Math.random() - 0.5) * shakeIntensity;
|
camera.position.y += (Math.random() - 0.5) * shakeIntensity;
|
||||||
|
|
||||||
if (globalDistance.current <= 0.1) {
|
if (globalDistance.current <= 0.1) {
|
||||||
window.location.href = '/';
|
|
||||||
fearState.registerCaught();
|
fearState.registerCaught();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,14 @@ export const fearState = {
|
|||||||
this.currentWidth = newWidth;
|
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);
|
this.finaleProgression = Math.min(this.finaleProgression + delta, FEAR_SETTINGS.EVENT_FINALE_DURATION);
|
||||||
|
} else {
|
||||||
|
window.location.href = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.emit();
|
this.emit();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user