优化BGMA连续播放与通关音量压低并强化节点缩放

This commit is contained in:
toshiocn
2026-10-23 14:25:35 +08:00
parent c13b850fb2
commit 90d83b3903
19 changed files with 65 additions and 53 deletions
@@ -117,7 +117,7 @@ test('fixed channels remain anchored at their block centers after number enlarge
const path=solve(level)[0],scene=renderBrightBoard(context(),level,path,320,300);
for(const channel of scene.channels)assert.deepEqual(channel.center,scene.byId.get(channel.cell).center,level.id+':'+channel.cell);
}
});
});
test('checkpoint ribbons trigger on correct arrival only and never duplicate per frame',()=>{
const level=pack.levels.find(l=>l.cells.some(c=>c.clue>1&&c.clue<l.cells.length)),route=solve(level)[0],n=level.cells.find(c=>c.clue>1&&c.clue<level.cells.length).clue,ctx=context();
@@ -129,9 +129,9 @@ test('checkpoint ribbons trigger on correct arrival only and never duplicate per
scene=renderBrightBoard(ctx,level,route.slice(0,n),375,400,{now:2800});assert.equal(scene.bursts.length,0);
feedback.reset();const wrong=context();renderBrightBoard(wrong,level,[],375,400,{now:1000});
scene=renderBrightBoard(wrong,level,[route[n-1]],375,400,{now:1100});assert.equal(scene.bursts.length,0);
});
});
test('checkpoint pulse is small, centered in time and settles without looping',async()=>{
const {checkpointScale}=await import('./src/bright-classroom/board-renderer.mjs');
assert.equal(checkpointScale(0),1);assert.equal(checkpointScale(45),1.065);assert.equal(checkpointScale(90),1);assert.equal(checkpointScale(1000),1);assert.equal(checkpointScale(45,true),1);
});
assert.equal(checkpointScale(0),1);assert.equal(checkpointScale(45),1.3);assert.equal(checkpointScale(90),1);assert.equal(checkpointScale(1000),1);assert.equal(checkpointScale(45,true),1);
});