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