use ggez; use ggez::event::KeyCode; use ggez::event::KeyMods; use ggez::{conf, event, timer, Context, GameResult}; use specs::{RunNow, World, WorldExt}; use std::path; mod audio; mod components; mod constants; mod entities; mod events; mod map; mod resources; mod systems; use crate::audio::initialize_sounds; use crate::components::*; use crate::map::*; use crate::resources::*; use crate::systems::*; // All the game state struct Game { world: World, } impl event::EventHandler for Game { fn update(&mut self, context: &mut Context) -> GameResult { // Run input system { let mut is = InputSystem {}; is.run_now(&self.world); } // Run gameplay state system { let mut gss = GameplayStateSystem {}; gss.run_now(&self.world); } // Get an update time resource { let mut time = self.world.write_resource::