mirror of
https://github.com/zyllian/zyllian.github.io.git
synced 2025-05-09 18:16:43 -07: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 */
|
/** how much mess the pet has made */
|
||||||
messCounter = 0;
|
messCounter = 0;
|
||||||
/** the pet's current happiness */
|
/** the pet's current happiness */
|
||||||
#happiness = MAX_HAPPINESS;
|
_happiness = MAX_HAPPINESS;
|
||||||
/** the time the pet was last updated */
|
/** the time the pet was last updated */
|
||||||
lastUpdate = Date.now();
|
lastUpdate = Date.now();
|
||||||
/** the time the egg was found */
|
/** the time the egg was found */
|
||||||
|
@ -312,7 +312,7 @@
|
||||||
|
|
||||||
/** the pet's happiness */
|
/** the pet's happiness */
|
||||||
get happiness() {
|
get happiness() {
|
||||||
return this.#happiness;
|
return this._happiness;
|
||||||
}
|
}
|
||||||
|
|
||||||
set happiness(amount) {
|
set happiness(amount) {
|
||||||
|
@ -321,7 +321,7 @@
|
||||||
} else if (amount > MAX_HAPPINESS) {
|
} else if (amount > MAX_HAPPINESS) {
|
||||||
amount = MAX_HAPPINESS;
|
amount = MAX_HAPPINESS;
|
||||||
}
|
}
|
||||||
this.#happiness = amount;
|
this._happiness = amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,6 +386,11 @@
|
||||||
btn.addEventListener("click", advance);
|
btn.addEventListener("click", advance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
passedAwayInfo.querySelector("button").addEventListener("click", () => {
|
||||||
|
pet = new Pet();
|
||||||
|
pet.updateDom();
|
||||||
|
});
|
||||||
|
|
||||||
const update = () => {
|
const update = () => {
|
||||||
pet.update();
|
pet.update();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue