From 09a2dd03bcf73071d8d3a3968e476f4fc5a3de7a Mon Sep 17 00:00:00 2001 From: Dejvino Date: Sat, 22 Nov 2025 06:27:06 +0100 Subject: [PATCH] Feature: musicians jump in time --- party-cathedral/src/scene/medieval-musicians.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/party-cathedral/src/scene/medieval-musicians.js b/party-cathedral/src/scene/medieval-musicians.js index 2533867..d740717 100644 --- a/party-cathedral/src/scene/medieval-musicians.js +++ b/party-cathedral/src/scene/medieval-musicians.js @@ -224,7 +224,12 @@ export class MedievalMusicians extends SceneFeature { mesh.position.y = area.y + musicianHeight / 2; } } else { - if (Math.random() < jumpChance && musicianObj.state !== 'JUMPING_PLANE' && musicianObj.state !== 'PREPARING_JUMP') { + let currentJumpChance = jumpChance * deltaTime; // Base chance over time + if (state.music && state.music.beatIntensity > 0.8) { + currentJumpChance = 0.1; // High, fixed chance on the beat + } + + if (Math.random() < currentJumpChance && musicianObj.state !== 'JUMPING_PLANE' && musicianObj.state !== 'PREPARING_JUMP') { musicianObj.isJumping = true; musicianObj.jumpHeight = jumpHeight + Math.random() * jumpVariance; musicianObj.jumpStartTime = time;