From 574f3c694dcce927ac87dfb79276775f0904bdc8 Mon Sep 17 00:00:00 2001 From: Ryan Symons <47405201+rsymons22@users.noreply.github.com> Date: Tue, 4 Nov 2025 22:24:23 -0500 Subject: Added enemy code structure and test movement --- dungeon/src/entity.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dungeon/src/entity.rs') diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 02184a9..5f0425f 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -21,6 +21,7 @@ pub enum Item { pub enum EntityKind { /// The main player Player, + Enemy, /// An item (not in an inventory) on the floor of the dungeon Item(Item), } @@ -89,6 +90,12 @@ impl Entity { let health = Some(PLAYER_FULL_HEALTH); Self::new(pos, dir, kind, health) } + + pub const fn enemy(pos: Pos, health: u32) -> Self { + let dir = Direction::East; + let kind = EntityKind::Enemy; + Self::new(pos, dir, kind, Some(health)) + } } /// The `Player` type represents the main player entity -- cgit v1.2.3-freya