wowie fixed some bugs whoopsie

This commit is contained in:
zyl 2024-06-24 23:24:19 -07:00
parent fde22ee9c2
commit 3d97fbb73c
No known key found for this signature in database

View file

@ -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();
};