feat: made the world call transparent irrespective of method used

This commit is contained in:
uttarayan21
2024-06-20 00:20:52 +05:30
parent 6e4950a1ca
commit 62e1a24e55
2 changed files with 8 additions and 4 deletions
+2 -4
View File
@@ -29,15 +29,13 @@ fn window_conf() -> Conf {
async fn main() { async fn main() {
let mut cursor = Cursor::default(); let mut cursor = Cursor::default();
cursor.handle_mouse(); 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 { loop {
// world.tick();
// world.draw();
cursor.draw(); cursor.draw();
world.draw(); world.draw();
world.tick(); world.tick();
world.ticker.next_frame(); world.next_frame();
next_frame().await next_frame().await
} }
+6
View File
@@ -55,3 +55,9 @@ impl<T: Drawable> Drawable for Tick<T> {
self.ticker.draw() self.ticker.draw()
} }
} }
impl Tick<crate::world::World> {
pub fn next_frame(&mut self) {
self.ticker.next_frame()
}
}