From 8ed8ea9d344554924bb2d800e090f08603ec83f8 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Sat, 3 Jan 2026 22:08:38 +0000 Subject: [PATCH] Feature: lasers synced to beat --- party-stage/src/scene/stage-lasers.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/party-stage/src/scene/stage-lasers.js b/party-stage/src/scene/stage-lasers.js index 415e864..422235f 100644 --- a/party-stage/src/scene/stage-lasers.js +++ b/party-stage/src/scene/stage-lasers.js @@ -124,15 +124,19 @@ export class StageLasers extends SceneFeature { isActive = true; this.stateTimer -= deltaTime; if (this.stateTimer <= 0) { - this.activationState = 'ACTIVE'; - this.stateTimer = 4.0; // Active duration + if (state.music.beatIntensity > 0.8) { + this.activationState = 'ACTIVE'; + this.stateTimer = 4.0; // Active duration + } } } else if (this.activationState === 'ACTIVE') { isActive = true; this.stateTimer -= deltaTime; if (this.stateTimer <= 0) { - this.activationState = 'FADEOUT'; - this.stateTimer = 1.0; // Fadeout duration + if (state.music.beatIntensity > 0.8) { + this.activationState = 'FADEOUT'; + this.stateTimer = 1.0; // Fadeout duration + } } } else if (this.activationState === 'FADEOUT') { isActive = true; @@ -184,7 +188,11 @@ export class StageLasers extends SceneFeature { if (this.activationState === 'WARMUP') { currentIntensity = 0; - flareScale = 1.0 - this.stateTimer; + if (this.stateTimer > 0) { + flareScale = 1.0 - this.stateTimer; + } else { + flareScale = 1.0 + Math.sin(time * 30) * 0.2; // Pulse while waiting for beat + } } else if (this.activationState === 'FADEOUT') { const fade = Math.max(0, this.stateTimer / 1.0); currentIntensity = 0;