added restart button in lives === 0 if
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user