Le luci da palco dell'Ingorgo: fasci colorati che spazzano dalle teste mobili, bagliore a tempo, strobo, laser verdi alla tecno di Cambray Digny, palla a specchi all'underground; solo alla festa (Andrea)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiECd9Quo9nEdXyjXYF8ma
This commit is contained in:
2026-10-30 22:24:52 +01:00
co-authored by Claude Opus 5.5
parent c132e94ed8
commit 187b4c48cb
4 changed files with 106 additions and 2 deletions
+20
View File
@@ -6,6 +6,7 @@ import { newIncanto, updateIncanto, drawIncanto, whiteness, T } from '../src/eng
import { Game, check, POSTER_READY } from '../src/engine/game.js';
import { story } from '../src/story/story.js';
import { settle } from './helpers.mjs';
import { render } from '../src/engine/render.js';
const ZONE = story.zones.find(z => z.flag === 'ingorgo');
// Fa scorrere il tempo finché l'incantesimo non è finito.
@@ -102,6 +103,25 @@ test('il manifesto ingrandito si chiude senza fare niente: niente festa', () =>
assert.ok(!g.state.flags.ingorgo && !g.closeup);
});
test('alla festa le luci da palco si muovono, e solo alla festa', () => {
globalThis.Image = class { set src(v) {} };
try {
const ops = [], gradient = { addColorStop() {} };
const ctx = new Proxy({}, { get: (o, k) => k in o ? o[k] : (...args) => { ops.push([k, ...args]); return gradient; }, set: (o, k, v) => { o[k] = v; return true; } });
const g = fromPiazza();
for (const scene of ZONE.scenes) {
g.go(scene); settle(g);
const lights = story.scenes[scene].effects.filter(e => e.phase === 'ingorgo');
assert.ok(lights.length, `${scene}: le luci`);
const frame = time => { ops.length = 0; render(ctx, g, { time }); return JSON.stringify(ops.filter(([op]) => op === 'lineTo' || op === 'fillRect')); };
assert.notEqual(frame(1000), frame(1700), `${scene}: le luci si muovono`);
}
g.go('via_cipriani'); settle(g); g.go('piazza'); settle(g);
ops.length = 0; render(ctx, g, { time: 1000 });
assert.ok(!ops.some(([op, x, y]) => op === 'moveTo' && x === 116 && y === 146), 'di giorno niente teste mobili');
} finally { delete globalThis.Image; }
});
test('le musiche e gli sfondi della festa esistono', () => {
const files = new Set();
for (const id of ZONE.scenes) {