summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-21 12:30:13 -0600
committertom <tom@ground-control>2015-11-21 12:30:13 -0600
commit7f79b2e216617ff74ebd41ac02663b20ef3d0904 (patch)
treee0eb8f820c61c45afcb1506f5b025eeb7e534691 /src/main.cpp
parent032d4f98c809bde6231ff78ba50e8c244334739f (diff)
began adding collision *added a location class for ease *much refractoring needed to fully implement it*
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 93693ee..2a33d65 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,19 +17,20 @@ int main()
while(true)
{
char c = getch();
-
+ Location l = cursor.getLocation();
if (c == 'h')
- cursor.move(cursor.getRow(),cursor.getCol()-1);
+ l.y = l.y-1;
else if (c == 'l')
- cursor.move(cursor.getRow(),cursor.getCol()+1);
+ l.y = l.y+1;
else if (c == 'k')
- cursor.move(cursor.getRow()-1,cursor.getCol());
+ l.x = l.x+1;
else if (c == 'j')
- cursor.move(cursor.getRow()+1,cursor.getCol());
+ l.x = l.x-1;
else if (c == 'q')
- break;
+ break;
- L.actions();
+ cursor.move(l);
+ L.action();
map.fillWindow();
L.draw(map.getWin());
cursor.draw(map.getWin());