]> git.localhorst.tv Git - blobs.git/blobdiff - src/app/states.cpp
primitive collision response
[blobs.git] / src / app / states.cpp
index e45356b5a29f6779a878ca07a6d4c490d44c591f..49ee8e23ac1793b88709cb6862fcb42d2d08a01c 100644 (file)
@@ -50,8 +50,15 @@ void MasterState::OnResize(int w, int h) {
 
 void MasterState::OnUpdate(int dt) {
        remain += dt;
-       while (remain >= FrameMS()) {
+#ifdef NDEBUG
+       int max_tick = 10;
+#else
+       // one tick per frame when debugging so pausing execution doesn't result in more ticks
+       int max_tick = 1;
+#endif
+       while (remain >= FrameMS() && max_tick > 0) {
                Tick();
+               --max_tick;
        }
 }