simulate pets upon reloading the page

This commit is contained in:
zyl 2024-06-25 13:46:44 -07:00
parent 8bf0cb4e55
commit 5cc0c80444
No known key found for this signature in database
2 changed files with 18 additions and 1 deletions

View file

@ -541,6 +541,13 @@
document.pet = pet;
}
const updates = Math.floor(
(Date.now() - pet.lastUpdate) / (60000 / UPDATES_PER_MINUTE)
);
for (let i = 0; i < updates; i++) {
pet.update();
}
pet.updateDom();
console.log(pet);