Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
NLlemain authored Oct 23, 2024
1 parent 1a041e0 commit 4144d00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions media/js/script.js
Original file line number Diff line number Diff line change
@@ -80,17 +80,17 @@ var cooldown = false;
var hearts = 3;
var lastHeartScore = 0;

var maxSpeed = 15;
var maxSpeed_2 = 20;
var maxSpeed = 12;
var maxSpeed_2 = 18;

for (var i = 0; i < carCount; i++) {
obstacles.push(new Obstacles(i));
}

// New variables for invulnerability and speed management
var isInvulnerable = false;
var invulnerabilityDuration = 2500; // 2.5 seconds
var speedRecoveryDuration = 2000; // 2 seconds for full recovery
var invulnerabilityDuration = 3500; // 3.5 seconds
var speedRecoveryDuration = 2500; // 2.5 seconds for full recovery
var originalSpeed = 4; // Base speed
var speed = originalSpeed;
var recoveryStartTime = null;
@@ -181,7 +181,7 @@ function update() {
};
}

if (Math.floor(playerScore) % 200 === 0 && Math.floor(playerScore) !== lastHeartScore && hearts < 3) {
if (Math.floor(playerScore) % 200 === 0 && Math.floor(playerScore) !== lastHeartScore && hearts < 5) {
hearts++;
lastHeartScore = Math.floor(playerScore);
newHP();

0 comments on commit 4144d00

Please sign in to comment.