added restart button in lives === 0 if

This commit is contained in:
Mees Roelofsz
2023-12-03 16:34:15 +01:00
parent ddf26c61ab
commit 08e2d5347a

View File

@@ -64,7 +64,6 @@ function life() {
textSize(40);
textAlign(CENTER);
text("Game Over", 500, 300);
}
if (key == ' ') {
lives = 1;
time = 0;
@@ -75,9 +74,9 @@ function life() {
hasMoved = false;
bullets = [];
shot = false;
}
}
}
function movementCheck() {
@@ -206,7 +205,7 @@ function randomAttackPattern() {
function spawnRandomBullet() {
let patern = random([1,2,3,4]);
let patern = random([2]);
if (patern == 1) {
nextAttack = random([1, 2, 3, 4]);
text(nextAttack, 30, 50);