summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-22 15:21:30 -0600
committertom <tom@ground-control>2015-11-22 15:21:30 -0600
commit9f0de11816fdbd0981aeaa3a840e3942fd249eb4 (patch)
tree2a0a8f5ac36b249e09f13848b33ab40d4c42b943 /src/main.cpp
parent86bf68cc1f2cc81589acc2c35c4875a1230b0267 (diff)
cleaned up a little and added pausing, the location vector in list.*pp is overkill, should probably just be using the men vector for everything
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index df5a563..022a2aa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,7 +16,8 @@ int main()
map.fillWindow();
L.draw(map.getWin());
cursor.draw(map.getWin());
-
+
+ bool paused = false;
while(true)
{
char c = getch();
@@ -31,9 +32,23 @@ int main()
l.x = l.x-1;
else if (c == 'q')
break;
-
+ else if (c == 'p')
+ {
+ if (paused)
+ {
+ timeout(100);
+ paused = false;
+ }
+ else
+ {
+ timeout(-1);
+ paused = true;
+ }
+ }
+
cursor.move(l);
- L.action();
+ if (!paused)
+ L.action();
map.fillWindow();
L.draw(map.getWin());
cursor.draw(map.getWin());