From 5c495b75f25c324b5e468d0aa80d0699bb5f3fd2 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 25 Oct 2017 09:56:36 -0500 Subject: -moved drawing to the map and out of character -now will just compute free spaces at list level and pass to characters --- src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 2e8ca3e..cd06942 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,9 +36,8 @@ fn main() { let mut cursor = Character::new('X', 3, Location{x:150,y:150}); - let list = List::new(map.impassable.to_vec()); + let mut list = List::new(map.impassable.to_vec()); - let paused = false; loop{ match main.getch() { Some(Input::Character(c)) => { @@ -54,13 +53,15 @@ fn main() { _ => () } - if !paused { - list.action(); - } + list.action(); map.fill(); - list.draw(&map.window); - cursor.draw(&map.window); + + for man in list.men.iter(){ + map.draw(man); + } + map.draw(&cursor); + view.center(cursor, &map.window); } -- cgit v1.2.3