From 905af769f641a98fdf0b45c77fcb3fe43e8daffb Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 25 Aug 2018 15:51:17 +0200 Subject: [PATCH] Add Configurable stepsPerSecond for engine logic --- lib/src/Engine.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/Engine.dart b/lib/src/Engine.dart index 539e6d2..d15987d 100644 --- a/lib/src/Engine.dart +++ b/lib/src/Engine.dart @@ -8,6 +8,8 @@ class Engine { // Game Tick Rate - *does* impact game speed TODO add configurable option int _MS_PER_STEP = 1000 ~/ 3; + int get stepsPerSecond => 1000 ~/ _MS_PER_STEP; + set stepsPerSecond(int val) => _MS_PER_STEP = 1000 ~/ val; // Max Frame (i.e. Rendering) rate - does *not* impact game speed final int _MS_PER_FRAME = 1000 ~/ 30;