summaryrefslogtreecommitdiff
path: root/dungeon
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-10-31 11:04:13 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-31 11:04:13 -0400
commitd330827da265fdb6bb51ae35704509b1a2723f28 (patch)
tree479c31cc7bca23b1412cb98cb070c50507044351 /dungeon
parentAdd LICENSE file (diff)
downloadDungeonCrawl-d330827da265fdb6bb51ae35704509b1a2723f28.tar.gz
DungeonCrawl-d330827da265fdb6bb51ae35704509b1a2723f28.tar.bz2
DungeonCrawl-d330827da265fdb6bb51ae35704509b1a2723f28.zip
graphics: add health/inventory ui rendering
Diffstat (limited to 'dungeon')
-rw-r--r--dungeon/src/entity.rs10
1 files changed, 8 insertions, 2 deletions
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)
}
}