hotfix
This commit is contained in:
parent
cb403d1e51
commit
4e006e64e8
@ -23,16 +23,17 @@ export class Stats {
|
||||
}
|
||||
incrementScore(value = 1) {
|
||||
__classPrivateFieldSet(this, _Stats_score, __classPrivateFieldGet(this, _Stats_score, "f") + value, "f");
|
||||
this.checkHighScore;
|
||||
this.checkHighScore();
|
||||
}
|
||||
resetScore() {
|
||||
__classPrivateFieldSet(this, _Stats_score, 0, "f");
|
||||
}
|
||||
updateScore(value) {
|
||||
__classPrivateFieldSet(this, _Stats_score, __classPrivateFieldGet(this, _Stats_score, "f") + value, "f");
|
||||
this.checkHighScore;
|
||||
this.checkHighScore();
|
||||
}
|
||||
checkHighScore() {
|
||||
console.log("Highscore: " + __classPrivateFieldGet(this, _Stats_highScore, "f") + " | Score: " + __classPrivateFieldGet(this, _Stats_score, "f"));
|
||||
if (__classPrivateFieldGet(this, _Stats_highScore, "f") < __classPrivateFieldGet(this, _Stats_score, "f")) {
|
||||
__classPrivateFieldSet(this, _Stats_highScore, __classPrivateFieldGet(this, _Stats_score, "f"), "f");
|
||||
localStorage.setItem(__classPrivateFieldGet(this, _Stats_highScoreStorageKey, "f"), __classPrivateFieldGet(this, _Stats_highScore, "f").toString());
|
||||
|
@ -14,7 +14,7 @@ export class Stats {
|
||||
incrementScore(value = 1) {
|
||||
this.#score += value;
|
||||
|
||||
this.checkHighScore;
|
||||
this.checkHighScore();
|
||||
}
|
||||
|
||||
resetScore(): void {
|
||||
@ -24,10 +24,11 @@ export class Stats {
|
||||
updateScore(value) {
|
||||
this.#score += value;
|
||||
|
||||
this.checkHighScore;
|
||||
this.checkHighScore();
|
||||
}
|
||||
|
||||
private checkHighScore() {
|
||||
console.log("Highscore: " + this.#highScore + " | Score: " + this.#score)
|
||||
if (this.#highScore < this.#score) {
|
||||
this.#highScore = this.#score;
|
||||
localStorage.setItem(this.#highScoreStorageKey, this.#highScore.toString());
|
||||
|
Loading…
Reference in New Issue
Block a user