From 5a10c0e1f72f838995ce61a48f45b5d6db8ade6f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 7 Jul 2018 19:07:30 +0200 Subject: [PATCH] Prepare Engine for Button responses --- lib/src/App.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); }