mirror of
https://github.com/zyllian/zyllian.github.io.git
synced 2025-01-18 03:32:30 -08:00
wowie fixed some bugs whoopsie
This commit is contained in:
parent
fde22ee9c2
commit
3d97fbb73c
1 changed files with 8 additions and 3 deletions
|
@ -122,7 +122,7 @@
|
|||
/** how much mess the pet has made */
|
||||
messCounter = 0;
|
||||
/** the pet's current happiness */
|
||||
#happiness = MAX_HAPPINESS;
|
||||
_happiness = MAX_HAPPINESS;
|
||||
/** the time the pet was last updated */
|
||||
lastUpdate = Date.now();
|
||||
/** the time the egg was found */
|
||||
|
@ -312,7 +312,7 @@
|
|||
|
||||
/** the pet's happiness */
|
||||
get happiness() {
|
||||
return this.#happiness;
|
||||
return this._happiness;
|
||||
}
|
||||
|
||||
set happiness(amount) {
|
||||
|
@ -321,7 +321,7 @@
|
|||
} else if (amount > MAX_HAPPINESS) {
|
||||
amount = MAX_HAPPINESS;
|
||||
}
|
||||
this.#happiness = amount;
|
||||
this._happiness = amount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -386,6 +386,11 @@
|
|||
btn.addEventListener("click", advance);
|
||||
}
|
||||
|
||||
passedAwayInfo.querySelector("button").addEventListener("click", () => {
|
||||
pet = new Pet();
|
||||
pet.updateDom();
|
||||
});
|
||||
|
||||
const update = () => {
|
||||
pet.update();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue