Merge pull request #174 from TwentyPorts/main

Fix laser cooldown bug
pull/178/head
chris 4 years ago committed by GitHub
commit 896d138a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

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

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

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

Loading…
Cancel
Save