diff --git a/web/game.js b/web/game.js index 1960daa..1785408 100644 --- a/web/game.js +++ b/web/game.js @@ -64,20 +64,19 @@ function life() { textSize(40); textAlign(CENTER); text("Game Over", 500, 300); + if (key == ' ') { + lives = 1; + time = 0; + bounceX = bossPosX; + bounceY = bossPosY; + initialPlayerPosX = playerPosX; + initialPlayerPosY = playerPosY; + hasMoved = false; + bullets = []; + shot = false; + } } - if (key == ' ') { - lives = 1; - time = 0; - bounceX = bossPosX; - bounceY = bossPosY; - initialPlayerPosX = playerPosX; - initialPlayerPosY = playerPosY; - hasMoved = false; - bullets = []; - shot = false; - - - } + } function movementCheck() { @@ -206,7 +205,7 @@ function randomAttackPattern() { function spawnRandomBullet() { - let patern = random([1,2,3,4]); + let patern = random([2]); if (patern == 1) { nextAttack = random([1, 2, 3, 4]); text(nextAttack, 30, 50);