summaryrefslogtreecommitdiff
path: root/game/src/main.rs
blob: 7e6c8bbb68f40b77e651dc4e47b05e0eff84c8db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use dungeon::*;
use graphics::*;

fn main() -> Result<()> {
	// Load the window
	let mut window = Window::new(720, 480, "game")?;
	// Initial game state
	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);
	}

	Ok(())
}