feat: add finale text

This commit is contained in:
2026-06-01 22:02:22 -03:00
parent b9eeed848b
commit 8c4080f10c
5 changed files with 102 additions and 3 deletions
+10 -2
View File
@@ -12,7 +12,10 @@ export const FEAR_SETTINGS = {
EVENT_NARROW_LOOP_COUNT: 2,
EVENT_RUST_LOOP_COUNT: 4,
EVENT_FINALE_LOOP_COUNT: 5
EVENT_FINALE_LOOP_COUNT: 5,
EVENT_FINALE_DURATION: 3,
EVENT_FINALE_TEXT_COUNT: 128
};
const listeners = new Set<() => void>();
@@ -23,6 +26,7 @@ export const fearState = {
isRustActive: false,
finaleTriggered: false,
wasCaught: false,
finaleProgression: 0,
subscribe(listener: () => void) {
listeners.add(listener);
@@ -39,8 +43,12 @@ export const fearState = {
if (Math.abs(this.currentWidth - newWidth) > 0.001) {
this.currentWidth = newWidth;
this.emit();
}
if (this.wasCaught && this.finaleProgression < FEAR_SETTINGS.EVENT_FINALE_DURATION)
this.finaleProgression = Math.min(this.finaleProgression + delta, FEAR_SETTINGS.EVENT_FINALE_DURATION);
this.emit();
},
registerLoop(direction: 'forward' | 'backward') {