From 06f66649967a09cb76f5d4efd1e41b7eaf67ed5b Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 15 Nov 2025 19:36:22 -0500 Subject: zombie texture --- assets/zombie.bmp | Bin 0 -> 8330 bytes dungeon/src/entity.rs | 6 +++--- graphics/src/render.rs | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 assets/zombie.bmp diff --git a/assets/zombie.bmp b/assets/zombie.bmp new file mode 100644 index 0000000..effca5e Binary files /dev/null and b/assets/zombie.bmp differ diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 7c16418..ced7656 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -55,9 +55,9 @@ impl EntityKind { /// Returns the move speed value for this type of entity in tiles/s pub const fn move_speed(&self) -> f32 { match &self { - Self::Player => 5., - Self::Zombie(_) => 4., - _ => 0., + Self::Player => 3.5, + Self::Zombie(_) => 2.0, + _ => 0.0, } } } diff --git a/graphics/src/render.rs b/graphics/src/render.rs index 8202e49..cbeb613 100644 --- a/graphics/src/render.rs +++ b/graphics/src/render.rs @@ -141,6 +141,7 @@ struct Textures { atlas: Texture2D, // Entity player: Texture2D, + zombie: Texture2D, // Misc error: Texture2D, // Fonts @@ -150,12 +151,14 @@ impl Textures { fn new(handle: &mut RaylibHandle, thread: &RaylibThread) -> crate::Result { let atlas = load_texture!(handle, thread, "assets/atlas.bmp"); let player = load_texture!(handle, thread, "assets/player.bmp"); + let zombie = load_texture!(handle, thread, "assets/zombie.bmp"); let error = load_texture!(handle, thread, "assets/error.bmp"); let font = load_texture!(handle, thread, "assets/font.bmp"); Ok(Self { atlas, player, + zombie, error, font, }) @@ -490,6 +493,7 @@ impl Renderer { let (fx, fy) = entity.fpos.xy(); let texture = match entity.kind { EntityKind::Player => &self.textures.player, + EntityKind::Zombie(_) => &self.textures.zombie, _ => &self.textures.error, }; let (mut ax, ay) = match entity.dir { -- cgit v1.2.3-freya