Cartello, titolo, introduzione e crediti a tutto schermo; inventario che si scorre

- Sul telefono il titolo inquadra il bastione col Regolo; il volume resta raggiungibile sopra.
- L'inventario è alto quanto i verbi, si scorre e mostra l'ultimo oggetto preso; la prova nel browser lo
  riempie con 16 oggetti e controlla che resti dentro lo schermo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017egeN2amL84ErjfgQFtEDn
This commit is contained in:
2026-10-23 22:45:06 +02:00
co-authored by Claude Opus 5.5
parent 616a84313d
commit 24d10ab4af
3 changed files with 37 additions and 6 deletions
+4
View File
@@ -196,6 +196,7 @@ let inventoryKey = '', hoverItem = null;
function updateInventory() {
const key = game.state.inventory.join(',') + '|' + command.item;
if (key === inventoryKey) return;
const grew = game.state.inventory.length > inventoryKey.split('|')[0].split(',').filter(Boolean).length;
inventoryKey = key;
const box = $('inventory');
box.replaceChildren(...game.state.inventory.map(id => {
@@ -223,6 +224,8 @@ function updateInventory() {
b.addEventListener('pointerleave', () => { if (hoverItem === id) hoverItem = null; });
return b;
}));
// Un oggetto nuovo finisce in fondo: si scorre fin lì, così si vede subito.
if (grew) box.scrollTop = box.scrollHeight;
}
// --- Dialoghi: scelte numerate, anche da tastiera.
@@ -303,6 +306,7 @@ function frame(now) {
const dt = Math.max(0, Math.min(0.1, (now - last) / 1000));
last = now;
const screen = !$('title').hidden ? 'title' : !$('splash').hidden ? 'splash' : !$('intro').hidden ? 'intro' : !$('ending').hidden ? 'ending' : 'game';
document.body.classList.toggle('full', screen === 'title' || screen === 'splash' || screen === 'intro' || !$('credits').hidden);
music.duck = voices.playing ? 0.45 : 1;
music.update(trackFor(story, { screen, scene: game?.state.scene }), dt);
// Un minuto senza toccare niente, a gioco fermo: pausa da sola.