diff options
| author | Ryan Symons <47405201+rsymons22@users.noreply.github.com> | 2025-11-07 20:13:51 -0500 |
|---|---|---|
| committer | Ryan Symons <47405201+rsymons22@users.noreply.github.com> | 2025-11-07 20:13:51 -0500 |
| commit | 2ed3362b566079faa825b0cd6e5435b92f085df2 (patch) | |
| tree | e0b6521790bdd9ffa0ebb9bba0056bcb08c41184 /dungeon/src/lib.rs | |
| parent | remove unused assets (diff) | |
| download | DungeonCrawl-2ed3362b566079faa825b0cd6e5435b92f085df2.tar.gz DungeonCrawl-2ed3362b566079faa825b0cd6e5435b92f085df2.tar.bz2 DungeonCrawl-2ed3362b566079faa825b0cd6e5435b92f085df2.zip | |
Moved Enemy logic to Entity Struct, fixed enemy drift while moving
Diffstat (limited to 'dungeon/src/lib.rs')
| -rw-r--r-- | dungeon/src/lib.rs | 7 |
1 files changed, 2 insertions, 5 deletions
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<Enemy>, + pub enemies: Vec<Entity>, } impl Dungeon { /// Creates a new `Dungeon`. @@ -71,7 +68,7 @@ impl From<Floor> 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, |