summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 714845c..82f0067 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -9,6 +9,7 @@ int main()
Timer fps;
int speed = 60;
+ bool pause = false;
while(e.gRun())
{
@@ -23,16 +24,19 @@ int main()
case SDLK_q: e.off(); break;
case SDLK_EQUALS: speed+=30; break;
case SDLK_MINUS: if(speed >30) speed-=30; break;
+ case SDLK_SPACE: pause=(pause)?(0):(1); break;
}
}
- main.Clear();
-
- L.Remove();
- L.Behavior();
- L.Place();
+ if(!pause){
+ main.Clear();
+
+ L.Remove();
+ L.Behavior();
+ L.Place();
- main.Render();
+ main.Render();
+ }
if(fps.getTicks() < (1000 / speed))
SDL_Delay((1000 / speed) - fps.getTicks());