added random spawn freq for bombs

This commit is contained in:
Joshua Perry 2022-05-29 13:32:59 +01:00
parent 0a1176ea92
commit 808c914faa
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ function spawnEnemy() {
alien.style.left = Math.floor(Math.random() * document.body.offsetWidth) + "px";
if (document.elementFromPoint(alien.offsetLeft, alien.offsetTop).classList.contains("alien") == false) {
document.body.appendChild(alien);
alienLogic = setInterval(spawnBomb, 3000);
alienLogic = setInterval(spawnBomb, Math.floor(Math.random() * 3000));
aliens.push([alien, alienLogic]);
console.log("Alien Spawned")
break;