Fix laser cooldown bug

This commit is contained in:
Raymond Xu
2021-01-18 19:35:37 -06:00
parent ac605c9982
commit 75f0073b47
5 changed files with 15 additions and 10 deletions

View File

@@ -60,8 +60,9 @@ class Hero extends GameObject {
let id = setInterval(() => {
if (this.cooldown > 0) {
this.cooldown -= 100;
} else {
clearInterval(id);
if(this.cooldown === 0) {
clearInterval(id);
}
}
}, 200);
}

View File

@@ -60,8 +60,9 @@ class Hero extends GameObject {
let id = setInterval(() => {
if (this.cooldown > 0) {
this.cooldown -= 100;
} else {
clearInterval(id);
if(this.cooldown === 0) {
clearInterval(id);
}
}
}, 200);
}

View File

@@ -58,8 +58,9 @@ class Hero extends GameObject {
let id = setInterval(() => {
if (this.cooldown > 0) {
this.cooldown -= 100;
} else {
clearInterval(id);
if(this.cooldown === 0) {
clearInterval(id);
}
}
}, 200);
}

View File

@@ -65,8 +65,9 @@ class Hero extends GameObject {
let id = setInterval(() => {
if (this.cooldown > 0) {
this.cooldown -= 100;
} else {
clearInterval(id);
if(this.cooldown === 0) {
clearInterval(id);
}
}
}, 200);
}

View File

@@ -60,8 +60,9 @@ class Hero extends GameObject {
let id = setInterval(() => {
if (this.cooldown > 0) {
this.cooldown -= 100;
} else {
clearInterval(id);
if(this.cooldown === 0) {
clearInterval(id);
}
}
}, 200);
}