diff options
author | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-12 10:47:03 +0100 |
---|---|---|
committer | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-12 10:47:03 +0100 |
commit | dbb1f294d59211df1ecdece2e2d1ac61f49c144a (patch) | |
tree | f54203786a965eefa375459315a1e9c3cae338e5 /src/main.rs | |
parent | 9f95c253433e84bff929e5f001a919cb84110003 (diff) | |
parent | 3794736d4bd1149247b8c4d39dc946466b550463 (diff) |
Merge branch 'master' of github.com:Etenil/roguerust
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 776e224..022315c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ mod computer; mod world; use character::Player; +use character::Character; use computer::Enemy; use pancurses::{Window, initscr, endwin}; use world::{Dungeon, Level, Generable, TileType}; @@ -39,7 +40,7 @@ fn render_level(window: &Window, level: &Level) { } } -fn debug_level(level: &Level) { +fn debug_level(level: Level) { let grid = level.to_tilegrid().unwrap(); for line in grid.raw_data().iter() { @@ -55,9 +56,20 @@ fn main() { let mut dungeon = Dungeon::new(80, 24, 5); dungeon.generate(); - for l in dungeon.levels { - debug_level(&l); - } + let start_location = dungeon.levels[0].get_start_point(); + + let mut character: Character = Character::new( + "Kshar".to_string(), + "Warror".to_string(), + 30, + 10, + 10, + 20, + start_location + ); + character.place(start_location); + + dungeon.levels.into_iter().map(debug_level); // let window = initscr(); |