GarGerry commited on
Commit
30c0846
·
verified ·
1 Parent(s): 35f0679

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +6 -3
index.html CHANGED
@@ -103,13 +103,16 @@
103
  }
104
  } else if (ballY >= window.innerHeight) {
105
  // Ball missed the platform
106
- remainingLives--;
107
- updateLives();
 
 
 
 
108
  if (remainingLives <= 0) {
109
  alert("Game Over! Your score is: " + currentScore);
110
  resetGame();
111
  }
112
- resetBall();
113
  }
114
  };
115
 
 
103
  }
104
  } else if (ballY >= window.innerHeight) {
105
  // Ball missed the platform
106
+ if (remainingLives > 0) {
107
+ remainingLives--;
108
+ updateLives();
109
+ resetBall();
110
+ }
111
+
112
  if (remainingLives <= 0) {
113
  alert("Game Over! Your score is: " + currentScore);
114
  resetGame();
115
  }
 
116
  }
117
  };
118