diff --git a/web/index.html b/web/index.html index 5dbd6e8..8828c30 100644 --- a/web/index.html +++ b/web/index.html @@ -11,7 +11,7 @@ -
+
diff --git a/web/main.dart b/web/main.dart index d58dbba..56be9a8 100644 --- a/web/main.dart +++ b/web/main.dart @@ -1,6 +1,7 @@ import 'dart:html'; import 'package:browserloop/game/Game.dart'; import 'package:browserloop/game/LoopExample.dart'; +import 'package:browserloop/src/03-VariableTimestep.dart'; import 'package:browserloop/src/04-FixedLoopVariableRender.dart'; import 'package:browserloop/src/02-AnimationFrameWhile.dart'; @@ -82,15 +83,16 @@ void activate(MouseEvent e) { resetExample(ex); switch (ex.query) { case "#while_loop": - print("#while_output loop added"); ex.loop = new WhileLoop(new Game(ex.canvas)); break; case "#fixed_variable": - print("#variable_output loop added"); ex.loop = new FixedLoopVariableRender(new Game(ex.canvas)); break; + case "#variable_timestep": + ex.loop = new VariableTimestep(new Game(ex.canvas)); + break; } - if (ex.canvas == ex.loop.game.canvas) print("CANVASSES ALIGN"); + if (ex.canvas != ex.loop.game.canvas) ex.loop.game.canvas = ex.canvas; querySelector(ex.query).append(new ButtonElement() ..text = "start" ..onClick.listen((e) {