Simplified main
This commit is contained in:
parent
29df5f872d
commit
59466243ec
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue