summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorRyan Symons <47405201+rsymons22@users.noreply.github.com>2025-11-04 22:24:23 -0500
committerRyan Symons <47405201+rsymons22@users.noreply.github.com>2025-11-04 22:24:23 -0500
commit574f3c694dcce927ac87dfb79276775f0904bdc8 (patch)
treebebe583ec5194c4a5a3187c04b79d0c84215e1b8 /game
parentAdd SDL feature flag (fixes wayland issues) (diff)
downloadDungeonCrawl-574f3c694dcce927ac87dfb79276775f0904bdc8.tar.gz
DungeonCrawl-574f3c694dcce927ac87dfb79276775f0904bdc8.tar.bz2
DungeonCrawl-574f3c694dcce927ac87dfb79276775f0904bdc8.zip
Added enemy code structure and test movement
Diffstat (limited to 'game')
-rw-r--r--game/src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/game/src/main.rs b/game/src/main.rs
index 22203c3..7e6c8bb 100644
--- a/game/src/main.rs
+++ b/game/src/main.rs
@@ -5,11 +5,17 @@ fn main() -> Result<()> {
// Load the window
let mut window = Window::new(720, 480, "game")?;
// Initial game state
- let dungeon = Dungeon::new();
+ let mut dungeon = Dungeon::new();
// Main game loop
while window.is_open() {
// TODO update game state
+
+ // Enemy Tick
+ for enemy in dungeon.enemies.iter_mut() {
+ enemy.update(dungeon.player.entity.pos, window.delta_time());
+ }
+
// Draw a single frame
window.renderer().draw_frame(&dungeon);
}