From 8d6f1d881211933b457729ac1ca2f8192bc4e276 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 20 Jul 2018 17:46:18 +0200 Subject: [PATCH] Examples - Fix Variable Timestep not Starting --- lib/src/03-VariableTimestep.dart | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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) {