feat: he is here.
This commit is contained in:
@@ -5,6 +5,7 @@ export const FEAR_SETTINGS = {
|
||||
HALLWAY_WIDTH: 6,
|
||||
HALLWAY_HEIGHT: 5,
|
||||
PLAYER_HEIGHT: 3,
|
||||
PLAYER_SPEED: 6,
|
||||
WALL_BUFFER: 0.6,
|
||||
};
|
||||
|
||||
@@ -14,6 +15,8 @@ export const fearState = {
|
||||
loopCount: 0,
|
||||
currentWidth: FEAR_SETTINGS.HALLWAY_WIDTH,
|
||||
isRustActive: false,
|
||||
finaleTriggered: false,
|
||||
wasCaught: false,
|
||||
|
||||
subscribe(listener: () => void) {
|
||||
listeners.add(listener);
|
||||
@@ -26,6 +29,7 @@ export const fearState = {
|
||||
|
||||
update(delta: number) {
|
||||
this.isRustActive = this.loopCount >= 3;
|
||||
this.finaleTriggered = this.loopCount >= 4;
|
||||
|
||||
const targetWidth = this.loopCount >= 2 ? 2.5 : FEAR_SETTINGS.HALLWAY_WIDTH;
|
||||
const newWidth = THREE.MathUtils.lerp(this.currentWidth, targetWidth, 2 * delta);
|
||||
@@ -38,7 +42,11 @@ export const fearState = {
|
||||
|
||||
registerLoop(direction: 'forward' | 'backward') {
|
||||
this.loopCount += 1;
|
||||
console.log(`Hallway looped ${direction}. Total loops: ${this.loopCount}`);
|
||||
this.emit();
|
||||
},
|
||||
|
||||
registerCaught() {
|
||||
this.wasCaught = true;
|
||||
this.emit();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user