Scale timer duration by equation difficulty
This commit is contained in:
parent
42e735569f
commit
b39dabfe9b
13
app.js
13
app.js
@ -687,9 +687,14 @@
|
||||
clearInterval(dementor.interval);
|
||||
if (!resume) dementor.progress = 0;
|
||||
dementor.timedOut = false;
|
||||
let speed = 250;
|
||||
const step = 0.02;
|
||||
if (game.timeTurnerCharges > 0) speed = 600;
|
||||
const difficulty = Math.max(game.currentFact.n1 || 1, game.currentFact.n2 || 1);
|
||||
let totalMs = 10000 + difficulty * 500; // base + more time for harder facts
|
||||
let tickMs = 200;
|
||||
if (game.timeTurnerCharges > 0) {
|
||||
tickMs = 400;
|
||||
totalMs *= 1.6;
|
||||
}
|
||||
const step = tickMs / totalMs;
|
||||
|
||||
updateDementorVisuals();
|
||||
dementor.interval = setInterval(() => {
|
||||
@ -700,7 +705,7 @@
|
||||
dementor.timedOut = true;
|
||||
handleDementorTimeout();
|
||||
}
|
||||
}, speed);
|
||||
}, tickMs);
|
||||
}
|
||||
|
||||
function updateDementorVisuals() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user