mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 21:46:15 -04:00
Removed precise physics option, uses the fastest ball speed instead
This commit is contained in:
parent
b891e0fafb
commit
1252bbca06
13 changed files with 15 additions and 105 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue