summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorRyan Symons <47405201+rsymons22@users.noreply.github.com>2025-11-07 17:54:11 -0500
committerRyan Symons <47405201+rsymons22@users.noreply.github.com>2025-11-07 17:54:11 -0500
commit651eed888fecbcede1d07800ac80fb637c7d8a33 (patch)
tree5ec525a6e5b373e91b021badac0970256e982c1a /game
parentgraphics: add a custom font (diff)
downloadDungeonCrawl-651eed888fecbcede1d07800ac80fb637c7d8a33.tar.gz
DungeonCrawl-651eed888fecbcede1d07800ac80fb637c7d8a33.tar.bz2
DungeonCrawl-651eed888fecbcede1d07800ac80fb637c7d8a33.zip
Basic enemy pathfinding/ai added
Diffstat (limited to 'game')
-rw-r--r--game/src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/game/src/main.rs b/game/src/main.rs
index f26ece4..919e22c 100644
--- a/game/src/main.rs
+++ b/game/src/main.rs
@@ -11,11 +11,12 @@ fn main() -> Result<()> {
while window.is_open() {
// TODO update game state
- // Enemy Tick
for enemy in dungeon.enemies.iter_mut() {
- enemy
- .entity
- .move_by_dir(Direction::West, window.delta_time());
+ enemy.handle_movement(
+ dungeon.player.entity.pos,
+ window.delta_time(),
+ dungeon.floor.tiles_mut(),
+ );
}
// Draw a single frame