Build 29084571

This commit is contained in:
Renan LE CARO 2025-04-19 16:51:56 +02:00
parent 1252bbca06
commit 603ebf319a
7 changed files with 12 additions and 8 deletions

View file

@ -449,8 +449,11 @@ export function tick() {
if (gameState.running) {
gameState.levelTime += timeDeltaMs * frames;
gameState.runStatistics.runTime += timeDeltaMs * frames;
const maxBallSpeed = Math.sqrt(Math.max(0,...gameState.balls.map(({vx,vy})=>vx*vx+vy*vy)))*frames
const steps = Math.ceil( maxBallSpeed / 8)
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);
}