главный экран

This commit is contained in:
azykov@mail.ru
2026-09-04 17:22:49 +03:00
parent 03a7552b9a
commit 982bbce813
5 changed files with 129 additions and 2 deletions
+14
View File
@@ -53,3 +53,17 @@ export function writeSave(data: SaveData): void {
// Ignore — e.g. private browsing mode or quota exceeded.
}
}
/** Deletes the saved game, if any — used when starting a brand new game. */
export function clearSave(): void {
try {
localStorage.removeItem(STORAGE_KEY);
} catch {
// Ignore — e.g. private browsing mode.
}
}
/** Whether a valid, resumable save currently exists (used to enable/disable "Continue" in the menu). */
export function hasSave(): boolean {
return loadSave() !== null;
}