diff --git a/src/main.rs b/src/main.rs index 55583e7..7ff571d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,8 +61,6 @@ fn main() { world.update_box_areas(); } - world.handle_collisions(); - world.render(&mut canvas, &texture, &font); ::std::thread::sleep(Duration::from_millis(25)); diff --git a/src/world.rs b/src/world.rs index d68bd9d..3ec01b0 100644 --- a/src/world.rs +++ b/src/world.rs @@ -112,6 +112,8 @@ impl World { Event::KeyUp { .. } => self.execute_command(Command::StopPlayer(player_id)), _ => {} } + + self.handle_item_collisions(); } fn if_collides_execute(&mut self, commands: Vec) { @@ -187,7 +189,7 @@ impl World { } /// Handles both, collisions with lounge and any box area - pub fn handle_collisions(&mut self) { + pub fn handle_item_collisions(&mut self) { self.handle_lounge_collisions(); self.handle_boxarea_collisions(); }