prevent gameplay time delta getting too high

This commit is contained in:
a dinosaur 2024-08-16 00:48:05 +10:00
parent fdec42daa3
commit 761fb71af3

View File

@ -42,11 +42,12 @@ class Game: GameDelegate {
}
func update(_ time: GameTime) {
let deltaTime = Float(time.delta.asFloat)
fpsCalculator.frame(deltaTime: time.delta) { fps in
print("FPS: \(fps)")
}
let deltaTime = min(Float(time.delta.asFloat), 1.0 / 15)
player.update(deltaTime: deltaTime, boxes: boxes)
camera.position = player.position
camera.rotation =