diff --git a/src/game/main.rs b/src/game/main.rs index 2413f2d..e3720ac 100644 --- a/src/game/main.rs +++ b/src/game/main.rs @@ -28,7 +28,7 @@ fn main() { let mut renderer = Renderer::new(game_width, game_height); - let mut after_loop = None; + let mut after_loop = Instant::now(); let mut running = true; loop { @@ -53,13 +53,8 @@ fn main() { } // Manage the physics - let duration = if let Some(instant) = after_loop { - Instant::now().duration_since(instant) - } else { - Duration::from_millis(20) - }; - - after_loop = Some(Instant::now()); + let duration = Instant::now().duration_since(after_loop); + after_loop = Instant::now(); scene.update(&duration);