mirror of
https://github.com/zyllian/zyllian.github.io.git
synced 2025-05-10 02:26:45 -07:00
simulate pets upon reloading the page
This commit is contained in:
parent
8bf0cb4e55
commit
5cc0c80444
2 changed files with 18 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue