Musichetta a 8 bit per il cartello «Manzolo (Poca) Art Presents»

tools/jingle.py la sintetizza da zero, a tempo con le scritte: arpeggio su MANZOLO, accordo su
Art, trombone triste sul (Poca), accordo finale su PRESENTS. Suona una volta sola; la musica del
titolo entra quando compare il titolo; saltando il cartello si salta anche lei. Senza un gesto
del giocatore il browser può tenerla muta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UdeKd62opy9PKgpQXtVctF
This commit is contained in:
2026-10-23 15:30:42 +02:00
co-authored by Claude Opus 5.5
parent c3ce1241d2
commit 5e6d7d4cfb
7 changed files with 100 additions and 3 deletions
+9 -1
View File
@@ -205,7 +205,7 @@ function frame(now) {
// sotto zero, il browser lancerebbe un errore e il ciclo dei fotogrammi si fermerebbe (gioco congelato).
const dt = Math.max(0, Math.min(0.1, (now - last) / 1000));
last = now;
const screen = !$('title').hidden || !$('splash').hidden ? 'title' : !$('intro').hidden ? 'intro' : !$('ending').hidden ? 'ending' : 'game';
const screen = !$('title').hidden ? 'title' : !$('splash').hidden ? 'splash' : !$('intro').hidden ? 'intro' : !$('ending').hidden ? 'ending' : 'game';
music.duck = voices.playing ? 0.45 : 1;
music.update(trackFor(story, { screen, scene: game?.state.scene }), dt);
if (game) {
@@ -232,8 +232,16 @@ function showSplash() {
if (done) return;
done = true;
$('splash').hidden = true;
jingle?.pause(); // saltato il cartello, si salta anche la musichetta
reveal();
};
// La musichetta: senza un gesto del giocatore il browser può non lasciarla partire, e allora il cartello resta muto.
const jingle = story.music?.splash ? new Audio(story.music.splash) : null;
if (jingle) {
jingle.volume = music.muted ? 0 : music.volume;
jingle.play().catch(() => {});
window.jingle = jingle; // per i test nel browser
}
setTimeout(reveal, SPLASH_FADE);
setTimeout(end, SPLASH_END);
$('splash').addEventListener('click', end);