diff --git a/web/game.js b/web/game.js index 593211a..1960daa 100644 --- a/web/game.js +++ b/web/game.js @@ -70,6 +70,11 @@ function life() { time = 0; bounceX = bossPosX; bounceY = bossPosY; + initialPlayerPosX = playerPosX; + initialPlayerPosY = playerPosY; + hasMoved = false; + bullets = []; + shot = false; } @@ -212,16 +217,16 @@ function spawnRandomBullet() { } if (nextAttack == 2) { shotPosX = random(0, 1000); - shotPosY = 600; + shotPosY = 610; bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0)); } if (nextAttack == 3) { - shotPosX = 0; + shotPosX = -10; shotPosY = random(0, 600); bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0)); } if (nextAttack == 4) { - shotPosX = 1000; + shotPosX = 1010; shotPosY = random(0, 600); bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0)); }