added changing projectile speeds
This commit is contained in:
13
web/game.js
13
web/game.js
@@ -21,6 +21,7 @@ let isDead = false;
|
|||||||
let bossPosX = width / 2;
|
let bossPosX = width / 2;
|
||||||
let bossPosY = 100;
|
let bossPosY = 100;
|
||||||
let shotSpeed = 12;
|
let shotSpeed = 12;
|
||||||
|
let shotSpeedAdj;
|
||||||
let projectile;
|
let projectile;
|
||||||
let projSize = 5;
|
let projSize = 5;
|
||||||
let shot = false;
|
let shot = false;
|
||||||
@@ -289,7 +290,8 @@ function phase() {
|
|||||||
switch (true) {
|
switch (true) {
|
||||||
case (time < 20):
|
case (time < 20):
|
||||||
phase1 = true;
|
phase1 = true;
|
||||||
paternArray = [1,5];
|
paternArray = [5];
|
||||||
|
shotSpeedAdj = 3;
|
||||||
push();
|
push();
|
||||||
fill(255, 0, 255);
|
fill(255, 0, 255);
|
||||||
textSize(10);
|
textSize(10);
|
||||||
@@ -298,6 +300,7 @@ function phase() {
|
|||||||
pop();
|
pop();
|
||||||
break;
|
break;
|
||||||
case (time < 60):
|
case (time < 60):
|
||||||
|
shotSpeedAdj = 5;
|
||||||
paternArray = [5];
|
paternArray = [5];
|
||||||
phase1 = false;
|
phase1 = false;
|
||||||
phase2 = true;
|
phase2 = true;
|
||||||
@@ -434,7 +437,7 @@ function spawnRandomBullet() {
|
|||||||
let shotWidth = random(0, width);
|
let shotWidth = random(0, width);
|
||||||
shotPosX = shotWidth;
|
shotPosX = shotWidth;
|
||||||
shotPosY = height;
|
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) {
|
if (nextWave == 2) {
|
||||||
@@ -442,7 +445,7 @@ function spawnRandomBullet() {
|
|||||||
let shotWidth = random(0, width);
|
let shotWidth = random(0, width);
|
||||||
shotPosX = shotWidth;
|
shotPosX = shotWidth;
|
||||||
shotPosY = 0;
|
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) {
|
if (nextWave == 3) {
|
||||||
@@ -450,7 +453,7 @@ function spawnRandomBullet() {
|
|||||||
let shotHeight = random(0, width);
|
let shotHeight = random(0, width);
|
||||||
shotPosX = 0;
|
shotPosX = 0;
|
||||||
shotPosY = shotHeight;
|
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) {
|
if (nextWave == 4) {
|
||||||
@@ -458,7 +461,7 @@ function spawnRandomBullet() {
|
|||||||
let shotHeight = random(0, width);
|
let shotHeight = random(0, width);
|
||||||
shotPosX = width;
|
shotPosX = width;
|
||||||
shotPosY = shotHeight;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user