diff --git a/src/game.rs b/src/game.rs index 5d1f58a..04bb6b1 100644 --- a/src/game.rs +++ b/src/game.rs @@ -11,16 +11,16 @@ use sdl2::ttf::Font; use sdl2::video::WindowContext; use sdl2::{pixels::Color, render::Canvas, video::Window}; +use crate::animation::AtlasTexture; use crate::audio::Audio; -use crate::animation::{AtlasTexture, FrameDrawn}; use crate::constants::RAW_BOARD; +use crate::debug::{DebugMode, DebugRenderer}; use crate::direction::Direction; -use crate::entity::{Entity, Renderable}; +use crate::edible::{reconstruct_edibles, Edible, EdibleKind}; +use crate::entity::Renderable; use crate::ghosts::blinky::Blinky; use crate::map::Map; use crate::pacman::Pacman; -use crate::debug::{DebugMode, DebugRenderer}; -use crate::edible::{reconstruct_edibles, Edible, EdibleKind}; // Embed texture data directly into the executable static PACMAN_TEXTURE_DATA: &[u8] = include_bytes!("../assets/32/pacman.png"); @@ -52,7 +52,7 @@ pub struct Game<'a> { edibles: Vec>, } -impl Game<'_> { +impl<'a> Game<'a> { /// Creates a new `Game` instance. /// /// # Arguments @@ -61,7 +61,7 @@ impl Game<'_> { /// * `texture_creator` - The SDL texture creator. /// * `ttf_context` - The SDL TTF context. /// * `_audio_subsystem` - The SDL audio subsystem (currently unused). - pub fn new<'a>( + pub fn new( canvas: &'a mut Canvas, texture_creator: &'a TextureCreator, ttf_context: &'a sdl2::ttf::Sdl2TtfContext, diff --git a/src/ghost.rs b/src/ghost.rs index 405d69c..96d1c35 100644 --- a/src/ghost.rs +++ b/src/ghost.rs @@ -303,7 +303,7 @@ impl<'a> Moving for Ghost<'a> { } } -impl Renderable for Ghost<'_> { +impl<'a> Renderable for Ghost<'a> { fn render(&self, canvas: &mut sdl2::render::Canvas) { let pos = self.base.base.pixel_position; self.body_sprite.render(canvas, pos, Direction::Right, None); diff --git a/src/main.rs b/src/main.rs index 3806be4..e70dd06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,7 +55,9 @@ unsafe fn attach_console() { mod animation; mod audio; mod constants; +mod debug; mod direction; +mod edible; mod entity; mod game; mod ghost; @@ -64,8 +66,6 @@ mod helper; mod map; mod modulation; mod pacman; -mod debug; -mod edible; /// The main entry point of the application. ///