feat: Making the game harder to 'beat'

This commit is contained in:
gauvainboiche
2026-10-08 17:17:21 +02:00
parent 2f7c307f0e
commit 8b15c76b14
20 changed files with 637 additions and 91 deletions
+9
View File
@@ -189,6 +189,13 @@ function catchUp(elapsedSeconds) {
);
}
/** Tell the player when an older save had to be rebalanced (see repairOlderSave in state.js). */
function reportRepair() {
if (!state.repaired) return;
state.repaired = false;
showToast(t('toast.repaired'), { sticky: true });
}
let lastFrame = Date.now();
function frame() {
@@ -279,6 +286,7 @@ createSettings({
}),
importText(text) {
state = parseImport(text, ctx); // throws before anything changes
reportRepair();
income = 0;
persist();
render();
@@ -322,6 +330,7 @@ async function boot() {
await setTheme(initialTheme.id);
state = loadSavedState() ?? createState(ctx);
reportRepair();
catchUp((Date.now() - state.savedAt) / 1000);
persist();
render();