From f198372b1c9f5cccdfbfc6cf57d8716a53be5bc8 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 21 Nov 2015 15:05:47 -0600 Subject: some cleaning and collision fully implemented --- src/List.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/List.cpp') diff --git a/src/List.cpp b/src/List.cpp index 94506f4..ed09c5a 100644 --- a/src/List.cpp +++ b/src/List.cpp @@ -4,7 +4,10 @@ List::List() { for(int i = 0; i < 10; i++) { - Character x ('@',4,150,150+i); + Location L; + L.x = 150; + L.y = 150+i; + Character x ('@',4,L); men.push_back(x); occupied.push_back(x.getLocation()); } @@ -19,9 +22,9 @@ void List::draw(WINDOW * w) void List::action() { for(int i = 0; i < 10; i++) - if(men[i].action(occupied)) - { - //rows[i] = 0; - //cols[i] = 0; - } + { + Location L = men[i].action(occupied); + if (L.x != 0 && L.y != 0) + occupied[i]=L; + } } -- cgit v1.2.3