diff --git a/web/game.js b/web/game.js index 765bfd5..1ed35f1 100644 --- a/web/game.js +++ b/web/game.js @@ -21,6 +21,7 @@ let isDead = false; let bossPosX = width / 2; let bossPosY = 100; let shotSpeed = 12; +let shotSpeedAdj; let projectile; let projSize = 5; let shot = false; @@ -289,7 +290,8 @@ function phase() { switch (true) { case (time < 20): phase1 = true; - paternArray = [1,5]; + paternArray = [5]; + shotSpeedAdj = 3; push(); fill(255, 0, 255); textSize(10); @@ -298,6 +300,7 @@ function phase() { pop(); break; case (time < 60): + shotSpeedAdj = 5; paternArray = [5]; phase1 = false; phase2 = true; @@ -434,7 +437,7 @@ function spawnRandomBullet() { let shotWidth = random(0, width); shotPosX = shotWidth; shotPosY = height; - bullets.push(new bullet(shotWidth, 0, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle)); + bullets.push(new bullet(shotWidth, 0, radius, shotSpeed / shotSpeedAdj, shotPosX, shotPosY, hasMoved, angle)); } } if (nextWave == 2) { @@ -442,7 +445,7 @@ function spawnRandomBullet() { let shotWidth = random(0, width); shotPosX = shotWidth; shotPosY = 0; - bullets.push(new bullet(shotWidth, height, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle)); + bullets.push(new bullet(shotWidth, height, radius, shotSpeed / shotSpeedAdj, shotPosX, shotPosY, hasMoved, angle)); } } if (nextWave == 3) { @@ -450,7 +453,7 @@ function spawnRandomBullet() { let shotHeight = random(0, width); shotPosX = 0; shotPosY = shotHeight; - bullets.push(new bullet(width, shotHeight, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle)); + bullets.push(new bullet(width, shotHeight, radius, shotSpeed / shotSpeedAdj, shotPosX, shotPosY, hasMoved, angle)); } } if (nextWave == 4) { @@ -458,7 +461,7 @@ function spawnRandomBullet() { let shotHeight = random(0, width); shotPosX = width; shotPosY = shotHeight; - bullets.push(new bullet(0, shotHeight, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle)); + bullets.push(new bullet(0, shotHeight, radius, shotSpeed / shotSpeedAdj, shotPosX, shotPosY, hasMoved, angle)); } }