Open blackgear opened 6 years ago
In ggez 0.4, we could use check_update_time() to limit the update frequency:
https://docs.rs/ggez/0.4.2/ggez/timer/fn.check_update_time.html
fn update(&mut self, ctx: &mut Context) -> GameResult<()> while(timer::check_update_time(ctx, 60)) { update_game_physics()?; } Ok(()) }
Instead of
fn update(&mut self, ctx: &mut Context) -> GameResult<()> if Instant::now() - self.last_update >= Duration::from_millis(MILLIS_PER_UPDATE) { } Ok(()) }
Hey thanks for this. You're absolutely right; I'll try to update this soon, or if you make a PR I'd be happy to merge it :)
In ggez 0.4, we could use check_update_time() to limit the update frequency:
https://docs.rs/ggez/0.4.2/ggez/timer/fn.check_update_time.html
Instead of