From d330827da265fdb6bb51ae35704509b1a2723f28 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 31 Oct 2025 11:04:13 -0400 Subject: graphics: add health/inventory ui rendering --- dungeon/src/entity.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'dungeon') diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 4ea6725..02184a9 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -2,6 +2,12 @@ use crate::{Direction, FPos, Pos, const_pos}; +/// `PLAYER_FULL_HEALTH` is the starting health of the player entity +pub const PLAYER_FULL_HEALTH: u32 = 10; + +/// `PLAYER_INVENTORY_SIZE` is the maximum size of the inventory +pub const PLAYER_INVENTORY_SIZE: usize = 5; + /// The `Item` type represents any item an entity may be using #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Item { @@ -46,7 +52,7 @@ impl Entity { /// let pos = Pos::new(0, 0).unwrap(); /// let dir = Direction::North; /// let kind = EntityKind::Player; - /// let health = Some(100); + /// let health = Some(10); /// let entity = Entity::new(pos, dir, kind, health); /// ``` #[must_use] @@ -80,7 +86,7 @@ impl Entity { pub const fn player(pos: Pos) -> Self { let dir = Direction::East; let kind = EntityKind::Player; - let health = Some(100); + let health = Some(PLAYER_FULL_HEALTH); Self::new(pos, dir, kind, health) } } -- cgit v1.2.3-freya