diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-15 19:36:22 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-15 19:36:22 -0500 |
| commit | 06f66649967a09cb76f5d4efd1e41b7eaf67ed5b (patch) | |
| tree | 85f0de793bd30894ad77dd29d708a7119e0c3a4b | |
| parent | graphics: add astar paths to debug rendering (diff) | |
| download | DungeonCrawl-06f66649967a09cb76f5d4efd1e41b7eaf67ed5b.tar.gz DungeonCrawl-06f66649967a09cb76f5d4efd1e41b7eaf67ed5b.tar.bz2 DungeonCrawl-06f66649967a09cb76f5d4efd1e41b7eaf67ed5b.zip | |
zombie texture
| -rw-r--r-- | assets/zombie.bmp | bin | 0 -> 8330 bytes | |||
| -rw-r--r-- | dungeon/src/entity.rs | 6 | ||||
| -rw-r--r-- | graphics/src/render.rs | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/assets/zombie.bmp b/assets/zombie.bmp Binary files differnew file mode 100644 index 0000000..effca5e --- /dev/null +++ b/assets/zombie.bmp 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<Self> { 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 { |