Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-2/cuujooceevii61
This commit is contained in:
11
web/game.js
11
web/game.js
@@ -70,6 +70,11 @@ function life() {
|
|||||||
time = 0;
|
time = 0;
|
||||||
bounceX = bossPosX;
|
bounceX = bossPosX;
|
||||||
bounceY = bossPosY;
|
bounceY = bossPosY;
|
||||||
|
initialPlayerPosX = playerPosX;
|
||||||
|
initialPlayerPosY = playerPosY;
|
||||||
|
hasMoved = false;
|
||||||
|
bullets = [];
|
||||||
|
shot = false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -212,16 +217,16 @@ function spawnRandomBullet() {
|
|||||||
}
|
}
|
||||||
if (nextAttack == 2) {
|
if (nextAttack == 2) {
|
||||||
shotPosX = random(0, 1000);
|
shotPosX = random(0, 1000);
|
||||||
shotPosY = 600;
|
shotPosY = 610;
|
||||||
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
||||||
}
|
}
|
||||||
if (nextAttack == 3) {
|
if (nextAttack == 3) {
|
||||||
shotPosX = 0;
|
shotPosX = -10;
|
||||||
shotPosY = random(0, 600);
|
shotPosY = random(0, 600);
|
||||||
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
||||||
}
|
}
|
||||||
if (nextAttack == 4) {
|
if (nextAttack == 4) {
|
||||||
shotPosX = 1000;
|
shotPosX = 1010;
|
||||||
shotPosY = random(0, 600);
|
shotPosY = random(0, 600);
|
||||||
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved, 0));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user