From 2ed3362b566079faa825b0cd6e5435b92f085df2 Mon Sep 17 00:00:00 2001 From: Ryan Symons <47405201+rsymons22@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:13:51 -0500 Subject: Moved Enemy logic to Entity Struct, fixed enemy drift while moving --- dungeon/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'dungeon/src/lib.rs') diff --git a/dungeon/src/lib.rs b/dungeon/src/lib.rs index e85b718..cfd2fbe 100644 --- a/dungeon/src/lib.rs +++ b/dungeon/src/lib.rs @@ -3,7 +3,6 @@ pub mod astar; pub mod bsp; -pub mod enemy; pub mod entity; pub mod map; pub mod pos; @@ -13,15 +12,13 @@ pub use entity::*; pub use map::*; pub use pos::*; -use crate::enemy::{Enemy, EnemyType}; - /// The `Dungeon` type represents the game state of the /// dungeon crawler. #[derive(Clone, Debug, PartialEq)] pub struct Dungeon { pub floor: Floor, pub player: Player, - pub enemies: Vec, + pub enemies: Vec, } impl Dungeon { /// Creates a new `Dungeon`. @@ -71,7 +68,7 @@ impl From for Dungeon { // TODO: initalize rest of game state // TODO: Randomize enemy positions/types - let enemies = vec![Enemy::new(EnemyType::Zombie, floor.random_pos())]; + let enemies = vec![Entity::zombie(floor.random_pos())]; Self { floor, -- cgit v1.2.3-freya