Removed precise physics option, uses the fastest ball speed instead

This commit is contained in:
Renan LE CARO 2025-04-19 16:50:26 +02:00
parent b891e0fafb
commit 1252bbca06
13 changed files with 15 additions and 105 deletions

View file

@ -449,7 +449,8 @@ export function tick() {
if (gameState.running) {
gameState.levelTime += timeDeltaMs * frames;
gameState.runStatistics.runTime += timeDeltaMs * frames;
const steps = isOptionOn("precise_physics") ? 4 : 1;
const maxBallSpeed = Math.sqrt(Math.max(0,...gameState.balls.map(({vx,vy})=>vx*vx+vy*vy)))*frames
const steps = Math.ceil( maxBallSpeed / 8)
for (let i = 0; i < steps; i++) gameStateTick(gameState, frames / steps);
}