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:
Mees Roelofsz
2023-11-30 21:10:59 +01:00

View File

@@ -70,13 +70,16 @@ function life() {
time = 0;
bounceX = bossPosX;
bounceY = bossPosY;
initialPlayerPosX = playerPosX;
initialPlayerPosY = playerPosY;
hasMoved = false;
bullets = [];
shot = false;
}
}
function movementCheck() {
if (playerPosX != initialPlayerPosX && playerPosY != initialPlayerPosY) {
if (playerPosX != initialPlayerPosX || playerPosY != initialPlayerPosY) {
hasMoved = true;
}
}
@@ -203,22 +206,22 @@ function spawnRandomBullet(){
nextAttack = random([1, 2, 3, 4]);
text(nextAttack, 30, 50);
if (nextAttack == 1) {
shotPosX = 500;
shotPosX = 510;
shotPosY = 100;
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved));
}
if (nextAttack == 2) {
shotPosX = random(0, 1000);
shotPosY = 600;
shotPosY = 610;
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved));
}
if (nextAttack == 3) {
shotPosX = 0;
shotPosX = -10;
shotPosY = random(0, 600);
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved));
}
if (nextAttack == 4) {
shotPosX = 1000;
shotPosX = 1010;
shotPosY = random(0, 600);
bullets.push(new bullet(playerPosX, playerPosY, radius, shotSpeed, shotPosX, shotPosY, hasMoved));