Prototipo del motore: scena, camminata, verbi, inventario, dialoghi, salvataggio

Motore guidato dai dati con due scene di prova (Piazza e salita alla Fortezza),
percorsi su area concava, clic intelligente e pressione lunga, test della soluzione
completa in node e nel browser con Playwright. Nel documento la leggenda del nonno.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 00:08:00 +02:00
co-authored by Claude Opus 5.5
parent 0c5cd240e4
commit 826f5f99ec
22 changed files with 1572 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
// Salvataggio nel browser: ogni accesso può fallire (navigazione privata, spazio pieno), e allora si gioca senza.
const KEY = 'leggenda-regolo-save';
export function readSave(storage) {
try {
const raw = storage.getItem(KEY);
return raw ? JSON.parse(raw) : null;
} catch {
return null;
}
}
export function writeSave(storage, data) {
try {
storage.setItem(KEY, JSON.stringify(data));
return true;
} catch {
return false;
}
}
export function clearSave(storage) {
try {
storage.removeItem(KEY);
return true;
} catch {
return false;
}
}