feat: Making the game harder to 'beat'
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user