summaryrefslogtreecommitdiff
path: root/src/List.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-21 15:05:47 -0600
committertom <tom@ground-control>2015-11-21 15:05:47 -0600
commitf198372b1c9f5cccdfbfc6cf57d8716a53be5bc8 (patch)
tree56cec43c262d8c6ccb401f2d278444920295ec43 /src/List.cpp
parent7f79b2e216617ff74ebd41ac02663b20ef3d0904 (diff)
some cleaning and collision fully implemented
Diffstat (limited to 'src/List.cpp')
-rw-r--r--src/List.cpp15
1 files changed, 9 insertions, 6 deletions
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;
+ }
}