Game solo - Fix solo collision when ball on player

- Add deltatime on ball
This commit is contained in:
hubourge
2024-11-13 18:23:48 +01:00
parent 428f8537b0
commit cf6ec99737
2 changed files with 46 additions and 19 deletions

View File

@ -79,19 +79,33 @@ class multiLocalGamePage
scene = null;
}
};
// /////////////
// const fps = 10; // change to 30 for 30 fps
// const frameDuration = 1000 / fps;
// let lastTime = 0;
// /////////////
function loop()
function loop(timestamp) // retirer timestamp
{
if (gameEndStatus)
{
renderer.setAnimationLoop(null);
gameFinish()
}
Ball.update();
Map.update();
Players.update();
if (renderer)
renderer.render(scene, camera);
// const deltaTime = timestamp - lastTime; //
// if (deltaTime >= frameDuration)//
// {
// lastTime = timestamp;//
//
Ball.update();
Map.update();
Players.update();
if (renderer) {
renderer.render(scene, camera);
}
// }
}
function gameFinish()