diff --git a/assets/voices/andrea-0b2ff063fb.mp3 b/assets/voices/andrea-0b2ff063fb.mp3 new file mode 100644 index 0000000..c9fe210 Binary files /dev/null and b/assets/voices/andrea-0b2ff063fb.mp3 differ diff --git a/assets/voices/andrea-200e4744c4.mp3 b/assets/voices/andrea-200e4744c4.mp3 new file mode 100644 index 0000000..6732343 Binary files /dev/null and b/assets/voices/andrea-200e4744c4.mp3 differ diff --git a/assets/voices/andrea-4db269c2b1.mp3 b/assets/voices/andrea-4db269c2b1.mp3 new file mode 100644 index 0000000..181524b Binary files /dev/null and b/assets/voices/andrea-4db269c2b1.mp3 differ diff --git a/assets/voices/andrea-98197f0db9.mp3 b/assets/voices/andrea-98197f0db9.mp3 new file mode 100644 index 0000000..98ecf58 Binary files /dev/null and b/assets/voices/andrea-98197f0db9.mp3 differ diff --git a/assets/voices/andrea-be07ea6e2f.mp3 b/assets/voices/andrea-be07ea6e2f.mp3 new file mode 100644 index 0000000..3958102 Binary files /dev/null and b/assets/voices/andrea-be07ea6e2f.mp3 differ diff --git a/assets/voices/index.json b/assets/voices/index.json index c29a1fe..fb76b7c 100644 --- a/assets/voices/index.json +++ b/assets/voices/index.json @@ -323,6 +323,26 @@ "file": "andrea-d7882fce87.mp3", "sec": 3.35 }, + "andrea|Un libro dimenticato su una panca. In copertina, niente titolo: solo un numero. 42.": { + "file": "andrea-be07ea6e2f.mp3", + "sec": 8.76 + }, + "andrea|Vediamo cosa c'è dentro...": { + "file": "andrea-98197f0db9.mp3", + "sec": 1.25 + }, + "andrea|Una pagina sola: «Qual era la domanda?».": { + "file": "andrea-200e4744c4.mp3", + "sec": 2.48 + }, + "andrea|Ecco. La risposta ce l'hanno tutti: è la domanda che non si ricorda nessuno.": { + "file": "andrea-4db269c2b1.mp3", + "sec": 5.78 + }, + "andrea|Lo lascio dov'è. Qualcun altro potrebbe cercare la stessa domanda.": { + "file": "andrea-0b2ff063fb.mp3", + "sec": 4.39 + }, "andrea|L'altare, coi candelieri dorati e i fiori freschi. Qualcuno li cambia ogni mattina, prima di tutti.": { "file": "andrea-a79f677fc1.mp3", "sec": 8.38 diff --git a/src/engine/render.js b/src/engine/render.js index 3dc208f..28b896a 100644 --- a/src/engine/render.js +++ b/src/engine/render.js @@ -21,7 +21,7 @@ function drawShape(ctx, s) { else for (let y = y0; y <= y1; y += step) ctx.fillRect(x0, y, x1 - x0, 1); } else if (s.text) { ctx.fillStyle = s.fill; - ctx.font = 'bold 11px monospace'; + ctx.font = s.size ? `${s.size}px "Press Start 2P", monospace` : 'bold 11px monospace'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(s.text, ...s.at); @@ -147,7 +147,9 @@ export function render(ctx, game, { hover, spots, debug, time = performance.now( if (bg) ctx.drawImage(bg, 0, 0, WIDTH, HEIGHT); for (const shape of scene.art ?? []) drawShape(ctx, shape); // Una forma può avere la sua condizione (`when`): la chiavetta nella griglia sparisce quando la si prende. - for (const h of game.hotspots()) for (const shape of h.art ?? []) if (check(shape.when, game.state)) drawShape(ctx, shape); + // I primi piani (`top`) invece vanno sopra a tutto, anche al buio e alle candele: si disegnano dopo. + const art = game.hotspots().flatMap(h => (h.art ?? []).filter(shape => check(shape.when, game.state))); + for (const shape of art) if (!shape.top) drawShape(ctx, shape); // Andrea e i personaggi della scena, dal più lontano al più vicino. const andrea = sprites.get('andrea'); const drawAndreaNow = () => andrea ? drawSprite(ctx, andrea, game.pose(), s.x, s.y, game.scaleAt(s.y), s.facing) @@ -159,6 +161,7 @@ export function render(ctx, game, { hover, spots, debug, time = performance.now( } for (const q of queue.sort((a, b) => a.y - b.y)) q.draw(); drawLights(ctx, scene, time); + for (const shape of art) if (shape.top) drawShape(ctx, shape); if (spots) drawSpots(ctx, game); if (debug) drawDebug(ctx, game, debug); if (hover) { diff --git a/src/story/story.js b/src/story/story.js index 0164be4..73d4974 100644 --- a/src/story/story.js +++ b/src/story/story.js @@ -513,6 +513,36 @@ export const story = { depth: [[256, 0.7], [360, 1.7]], entry: [320, 352], hotspots: [ + // Il libro dimenticato su una panca (idea di Andrea, 24 ottobre): in copertina la risposta, dentro la domanda. + { + id: 'libro_panca', name: 'libro su una panca', box: [112, 262, 30, 18], at: [278, 318], face: 'left', + art: [ + { rect: [120, 270, 14, 4], fill: '#7a1f1f' }, { rect: [121, 273, 12, 1], fill: '#efe3c0' }, { rect: [126, 271, 3, 2], fill: '#e8c25a' }, + // Da vicino: la copertina col 42, poi l'unica pagina con la domanda. + { when: 'copertina_42', top: true, rect: [255, 60, 130, 170], fill: '#7a1f1f' }, + { when: 'copertina_42', top: true, rect: [263, 68, 114, 154], fill: '#8e2a26' }, + { when: 'copertina_42', top: true, text: '42', at: [320, 146], size: 48, fill: '#e8c25a' }, + { when: 'pagina_domanda', top: true, rect: [240, 70, 160, 150], fill: '#f1e6c4' }, + { when: 'pagina_domanda', top: true, rect: [240, 70, 160, 4], fill: '#d8c79a' }, + { when: 'pagina_domanda', top: true, text: 'Qual era', at: [320, 132], size: 12, fill: '#2a1f30' }, + { when: 'pagina_domanda', top: true, text: 'la domanda?', at: [320, 156], size: 12, fill: '#2a1f30' }, + ], + actions: { + look: [ + { set: 'copertina_42' }, + { say: 'Un libro dimenticato su una panca. In copertina, niente titolo: solo un numero. 42.' }, + { unset: 'copertina_42' }, + ], + open: [ + { say: 'Vediamo cosa c\'è dentro...' }, + { set: 'pagina_domanda' }, + { say: 'Una pagina sola: «Qual era la domanda?».' }, + { unset: 'pagina_domanda' }, + { say: 'Ecco. La risposta ce l\'hanno tutti: è la domanda che non si ricorda nessuno.' }, + ], + take: [{ say: 'Lo lascio dov\'è. Qualcun altro potrebbe cercare la stessa domanda.' }], + }, + }, { id: 'altare', name: 'altare', box: [270, 186, 100, 64], at: [320, 262], face: 'up', actions: { @@ -1295,7 +1325,7 @@ export const story = { }, }, { - id: 'al_cancello', name: 'dal cancello verde, verso il posticino della Carza', box: [380, 300, 120, 60], at: [440, 330], exit: { scene: 'carza', at: [440, 290], face: 'left' }, + id: 'al_cancello', name: 'dal cancello verde, verso il posticino della Carza', box: [470, 140, 120, 130], at: [515, 280], exit: { scene: 'carza', at: [440, 290], face: 'left' }, }, ], }, @@ -1483,7 +1513,7 @@ export const story = { }, }, { - id: 'cancello', name: 'cancello verde, verso il tennis della chiesa', box: [460, 150, 46, 132], at: [440, 290], face: 'right', exit: { scene: 'tennis_chiesa', at: [440, 330], face: 'up' }, + id: 'cancello', name: 'cancello verde, verso il tennis della chiesa', box: [460, 150, 46, 132], at: [440, 290], face: 'right', exit: { scene: 'tennis_chiesa', at: [515, 285], face: 'left' }, actions: { look: [{ say: 'Il cancello verde, sempre aperto. Di là c\'è il tennis della chiesa.' }], },