mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 21:46:15 -04:00
Build 29084571
This commit is contained in:
parent
1252bbca06
commit
603ebf319a
7 changed files with 12 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue