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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!--Basic Game-loop-->
|
<!--Basic Game-loop-->
|
||||||
<div id="while_output"></div>
|
<div id="while_loop"></div>
|
||||||
<div id="variable_timestep"></div>
|
<div id="variable_timestep"></div>
|
||||||
<div id="fixed_variable"></div>
|
<div id="fixed_variable"></div>
|
||||||
<!--<button id="basic_start">start</button>-->
|
<!--<button id="basic_start">start</button>-->
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'dart:html';
|
import 'dart:html';
|
||||||
import 'package:browserloop/game/Game.dart';
|
import 'package:browserloop/game/Game.dart';
|
||||||
import 'package:browserloop/game/LoopExample.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/04-FixedLoopVariableRender.dart';
|
||||||
import 'package:browserloop/src/02-AnimationFrameWhile.dart';
|
import 'package:browserloop/src/02-AnimationFrameWhile.dart';
|
||||||
|
|
||||||
|
@ -82,15 +83,16 @@ void activate(MouseEvent e) {
|
||||||
resetExample(ex);
|
resetExample(ex);
|
||||||
switch (ex.query) {
|
switch (ex.query) {
|
||||||
case "#while_loop":
|
case "#while_loop":
|
||||||
print("#while_output loop added");
|
|
||||||
ex.loop = new WhileLoop(new Game(ex.canvas));
|
ex.loop = new WhileLoop(new Game(ex.canvas));
|
||||||
break;
|
break;
|
||||||
case "#fixed_variable":
|
case "#fixed_variable":
|
||||||
print("#variable_output loop added");
|
|
||||||
ex.loop = new FixedLoopVariableRender(new Game(ex.canvas));
|
ex.loop = new FixedLoopVariableRender(new Game(ex.canvas));
|
||||||
break;
|
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()
|
querySelector(ex.query).append(new ButtonElement()
|
||||||
..text = "start"
|
..text = "start"
|
||||||
..onClick.listen((e) {
|
..onClick.listen((e) {
|
||||||
|
|
Loading…
Reference in a new issue