Scuola, strada per Cardetole, indovinello di San Pietro con la chiave dell'oratorio, verbo Butta e Pausa
- La scuola (sfondo di Codex dalla foto di Andrea): dalla salita di Villa Adami, dal cancello alle porte a vetri. - Alla Pieve la strada per Cardetole (per ora una battuta). - La statua di San Pietro chiede quanti bastioni ha la Fortezza: con la risposta giusta dà la chiave dell'oratorio; la porta, aperta una volta, resta aperta e la chiave sparisce. Voce propria per San Pietro. - Verbo Butta: solo gli oggetti droppable (il libro), quelli che servono alla storia no. - Pulsante Pausa (o Esc): Riprendi, Mappa, Crediti, Torna al titolo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017egeN2amL84ErjfgQFtEDn
This commit is contained in:
+25
-1
@@ -101,6 +101,27 @@ function openMap() {
|
||||
$('map').hidden = false;
|
||||
}
|
||||
$('map-button').addEventListener('click', openMap);
|
||||
|
||||
// --- Pausa: ferma il gioco; da qui mappa, crediti o ritorno al titolo (la partita resta salvata per «Continua»).
|
||||
function openPause() {
|
||||
if (!running) return;
|
||||
running = false;
|
||||
command.reset();
|
||||
$('pause-map').hidden = game.mapPlaces().length < 2;
|
||||
$('pause').hidden = false;
|
||||
}
|
||||
function closePause() {
|
||||
$('pause').hidden = true;
|
||||
running = true;
|
||||
}
|
||||
$('pause-button').addEventListener('click', openPause);
|
||||
$('resume').addEventListener('click', closePause);
|
||||
$('pause-map').addEventListener('click', () => { closePause(); openMap(); });
|
||||
$('to-title').addEventListener('click', () => {
|
||||
$('pause').hidden = true;
|
||||
game.onSave(game.snapshot());
|
||||
showTitle();
|
||||
});
|
||||
$('close-map').addEventListener('click', () => { $('map').hidden = true; });
|
||||
|
||||
function showTitle() {
|
||||
@@ -195,13 +216,15 @@ function updateChoices() {
|
||||
window.addEventListener('keydown', e => {
|
||||
if (e.target === $('volume')) return;
|
||||
if (!$('credits').hidden) { if (e.key === 'Escape') $('credits').hidden = true; return; }
|
||||
if (!$('pause').hidden) { if (e.key === 'Escape') closePause(); return; }
|
||||
if (!$('map').hidden) { if (e.key === 'Escape' || e.key === 'p' || e.key === 'P') $('map').hidden = true; return; }
|
||||
if ((e.key === 'p' || e.key === 'P') && running) { openMap(); return; }
|
||||
if (!$('intro').hidden && [' ', 'Enter'].includes(e.key)) { e.preventDefault(); nextIntro(); return; }
|
||||
if (e.key === 'm' || e.key === 'M') { music.toggle(); saveAudio(); showSound(); return; }
|
||||
if (!running) return;
|
||||
if ([' ', '.', 'Enter'].includes(e.key) && game.speech) { e.preventDefault(); game.skip(); return; }
|
||||
if (e.key === 'Escape') command.reset();
|
||||
// Esc annulla il comando a metà; se non c'è niente da annullare, mette in pausa.
|
||||
if (e.key === 'Escape') { if (command.verb || command.item || game.dialogue) command.reset(); else openPause(); }
|
||||
const n = Number(e.key);
|
||||
if (game.dialogue && n >= 1 && n <= 9) game.choose(n - 1);
|
||||
});
|
||||
@@ -233,6 +256,7 @@ function updateUi() {
|
||||
updateSpeech();
|
||||
// Il pulsante della mappa c'è solo in partita, fuori dai dialoghi, e quando c'è almeno un altro posto dove andare.
|
||||
$('map-button').hidden = !running || !!game.dialogue || game.mapPlaces().length < 2;
|
||||
$('pause-button').hidden = !running;
|
||||
if (game.state.ended && !game.speech && !game.queue.length) {
|
||||
running = false;
|
||||
$('ending').hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user