diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-14 21:48:24 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-14 21:48:34 -0500 |
| commit | 220d5c8aa8418d37ee9027c817d27b3e50380b81 (patch) | |
| tree | 4a092dd67d9b2b824504e9cc851df5145c9606ea /dungeon | |
| parent | graphics: make more constants dependant on texture size (diff) | |
| download | DungeonCrawl-220d5c8aa8418d37ee9027c817d27b3e50380b81.tar.gz DungeonCrawl-220d5c8aa8418d37ee9027c817d27b3e50380b81.tar.bz2 DungeonCrawl-220d5c8aa8418d37ee9027c817d27b3e50380b81.zip | |
graphics: new textures!
Diffstat (limited to 'dungeon')
| -rw-r--r-- | dungeon/src/entity.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 592c1ee..f56f8dd 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -323,6 +323,11 @@ impl Entity { next_move = *last; } } + + /// Returns the position in front of the entity + pub const fn in_front(&self) -> Option<Pos> { + self.pos.step(self.dir) + } } /// The `Player` type represents the main player entity |