summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@siu.edu>2017-10-25 09:56:36 -0500
committerTom Barrett <tombarrett@siu.edu>2017-10-25 09:56:36 -0500
commit5c495b75f25c324b5e468d0aa80d0699bb5f3fd2 (patch)
tree0572763449f700fc407d17f185a2ce1c1495114f /src/main.rs
parent5b7a80d0e1fc0fcddbfad976a3f0fbbf7f6cd2ab (diff)
-moved drawing to the map and out of character
-now will just compute free spaces at list level and pass to characters
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 8 insertions, 7 deletions
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);
}