feat: add finale text
This commit is contained in:
+10
-2
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user