Fix laser cooldown bug

pull/174/head
Raymond Xu 4 years ago
parent ac605c9982
commit 75f0073b47

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

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

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

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

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

Loading…
Cancel
Save