sam
2023-12-13 12:58:49 +01:00

View File

@@ -54,6 +54,7 @@ let y5;
let homescreenOn = true;
let chosen = false;
let finalPhase = false;
let nextWave = [];
let bulletAmount = 5;
//let myBullet = new bullet();
@@ -347,9 +348,9 @@ function spawnRandomBullet() {
angle = 0;
}
if (patern == 5) {
let nextAttack = random([1, 2, 3, 4]);
nextWave = random([1, 2, 3, 4]);
bulletAmount = 15;
if (nextAttack == 1) {
if (nextWave == 1) {
for (let i = 0; i < random(8, 15); i++) {
let shotWidth = random(0, width);
shotPosX = shotWidth;
@@ -357,7 +358,7 @@ function spawnRandomBullet() {
bullets.push(new bullet(shotWidth, 0, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle));
}
}
if (nextAttack == 2) {
if (nextWave == 2) {
for (let i = 0; i < random(8, 10); i++) {
let shotWidth = random(0, width);
shotPosX = shotWidth;
@@ -365,7 +366,7 @@ function spawnRandomBullet() {
bullets.push(new bullet(shotWidth, height, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle));
}
}
if (nextAttack == 3) {
if (nextWave == 3) {
for (let i = 0; i < random(8, 10); i++) {
let shotHeight = random(0, width);
shotPosX = 0;
@@ -373,7 +374,7 @@ function spawnRandomBullet() {
bullets.push(new bullet(width, shotHeight, radius, shotSpeed / 5, shotPosX, shotPosY, hasMoved, angle));
}
}
if (nextAttack == 4) {
if (nextWave == 4) {
for (let i = 0; i < random(8, 10); i++) {
let shotHeight = random(0, width);
shotPosX = width;