diff options
| author | Ryan Symons <47405201+rsymons22@users.noreply.github.com> | 2025-11-04 22:24:23 -0500 |
|---|---|---|
| committer | Ryan Symons <47405201+rsymons22@users.noreply.github.com> | 2025-11-04 22:24:23 -0500 |
| commit | 574f3c694dcce927ac87dfb79276775f0904bdc8 (patch) | |
| tree | bebe583ec5194c4a5a3187c04b79d0c84215e1b8 /game | |
| parent | Add SDL feature flag (fixes wayland issues) (diff) | |
| download | DungeonCrawl-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.rs | 8 |
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); } |