Examples - Fix missing div container
This commit is contained in:
parent
8d6f1d8812
commit
bc02cf6382
2 changed files with 6 additions and 4 deletions
|
@ -11,7 +11,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<!--Basic Game-loop-->
|
||||
<div id="while_output"></div>
|
||||
<div id="while_loop"></div>
|
||||
<div id="variable_timestep"></div>
|
||||
<div id="fixed_variable"></div>
|
||||
<!--<button id="basic_start">start</button>-->
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue