From 9f0de11816fdbd0981aeaa3a840e3942fd249eb4 Mon Sep 17 00:00:00 2001 From: tom Date: Sun, 22 Nov 2015 15:21:30 -0600 Subject: 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 --- src/main.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') 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()); -- cgit v1.2.3