Prepare Engine for Button responses

This commit is contained in:
Marty Oehme 2018-07-07 19:07:30 +02:00
parent 020bb6b918
commit 5a10c0e1f7

View file

@ -27,6 +27,11 @@ class App {
_elapsed.start(); _elapsed.start();
} }
void reset () {
grid = new Grid(100, 100);
running = false;
}
void process(num now) { void process(num now) {
_drawLag+= _elapsed.elapsedMilliseconds; _drawLag+= _elapsed.elapsedMilliseconds;
_updateLag += _elapsed.elapsedMilliseconds; _updateLag += _elapsed.elapsedMilliseconds;
@ -38,7 +43,7 @@ class App {
print("ERROR STUCK IN UPDATE LOOP"); print("ERROR STUCK IN UPDATE LOOP");
break; break;
} }
update(); if (running == true) update();
_updateLag -= _MS_PER_STEP; _updateLag -= _MS_PER_STEP;
} }
@ -50,7 +55,7 @@ class App {
void update() { void update() {
// print("updating"); // print("updating");
if (running == true) grid.update(); grid.update();
} }