Add the test map reader and two-way test matcher scripts

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-03 20:53:42 -08:00
1 parent e681d1f70d
commit aecc3afb4c
11 files changed
+1647 -27

No files matched your search

@@ -1066,9 +1066,10 @@ export function wagonArt(d) {
ctx.restore();
}
// The mob's meter along the top left: how far back they are, red as they close, with a word when it matters.
function meter(ctx, v, c) {
const x = 4;
// The mob's meter along the top left of the screen (`cam` is the view's left edge: `front` draws in
// room units, so it follows the camera): how far back they are, red as they close, with a word when it matters.
function meter(ctx, v, c, cam) {
const x = cam + 4;
const y = 9.2;
const w = 34;
const near = clamp(1 - c.gap / GAP_MAX, 0, 1);
@@ -1147,7 +1148,7 @@ export function wagonArt(d) {
ctx.fillRect(cam, 0, 40, FH);
ctx.globalAlpha = 1;
}
meter(ctx, v, c);
meter(ctx, v, c, cam);
}
}
+5
View File
@@ -508,6 +508,9 @@ function blip(c, type, from, to, t0, seconds, peak) {
osc.type = type;
osc.frequency.setValueAtTime(from, t0);
osc.frequency.exponentialRampToValueAtTime(to, end);
// Silent from the start: a gain node is 1 until its first scheduled value,
// which made a part that starts later click.
gain.gain.value = FLOOR;
gain.gain.setValueAtTime(FLOOR, t0);
gain.gain.exponentialRampToValueAtTime(peak, t0 + ATTACK);
gain.gain.exponentialRampToValueAtTime(FLOOR, end);
@@ -524,6 +527,8 @@ function voice(c, p, t0, peak, k) {
const end = t0 + p.seconds;
const gain = c.createGain();
const top = Math.max(FLOOR * 10, peak * (p.gain ?? 1));
// Silent from the start (see blip): no click before a delayed part begins.
gain.gain.value = FLOOR;
gain.gain.setValueAtTime(FLOOR, t0);
gain.gain.exponentialRampToValueAtTime(top, t0 + Math.min(p.attack ?? ATTACK, p.seconds * 0.8));
gain.gain.exponentialRampToValueAtTime(FLOOR, end);