diff --git a/lib/src/03-VariableTimestep.dart b/lib/src/03-VariableTimestep.dart index 1a6b147..668a508 100644 --- a/lib/src/03-VariableTimestep.dart +++ b/lib/src/03-VariableTimestep.dart @@ -1,15 +1,3 @@ -//void main() { -// double lastTime = performance.now(); -// while(true) { -// double currentTime = performance.now(); -// double delta = currentTime - lastTime; -// -// update(delta); -// -// lastTime = currentTime; -// } -//} - import 'dart:html'; import 'package:browserloop/game/Game.dart'; import 'package:browserloop/game/LoopExample.dart'; @@ -25,6 +13,7 @@ class VariableTimestep implements LoopExample { Stopwatch elapsed = new Stopwatch(); VariableTimestep(Game this.game) { + window.requestAnimationFrame(eventloop); } void eventloop(num time) {