From 62e1a24e554e974c809657e8882e98e83c78c408 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Thu, 20 Jun 2024 00:20:52 +0530 Subject: [PATCH] feat: made the world call transparent irrespective of method used --- src/main.rs | 6 ++---- src/tick.rs | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index bd48f22..bea7d84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,15 +29,13 @@ fn window_conf() -> Conf { async fn main() { let mut cursor = Cursor::default(); cursor.handle_mouse(); - let mut world = world::World::new().every(Duration::from_millis(15)); + let mut world = world::World::new().every(Duration::from_millis(5)); loop { - // world.tick(); - // world.draw(); cursor.draw(); world.draw(); world.tick(); - world.ticker.next_frame(); + world.next_frame(); next_frame().await } diff --git a/src/tick.rs b/src/tick.rs index 5a705de..c2c4229 100644 --- a/src/tick.rs +++ b/src/tick.rs @@ -55,3 +55,9 @@ impl Drawable for Tick { self.ticker.draw() } } + +impl Tick { + pub fn next_frame(&mut self) { + self.ticker.next_frame() + } +}