Examples - Add Variable Timestep Example
This commit is contained in:
parent
5b7552216d
commit
828b39c1d0
4 changed files with 54 additions and 4 deletions
|
|
@ -12,7 +12,8 @@
|
|||
<body>
|
||||
<!--Basic Game-loop-->
|
||||
<div id="while_output"></div>
|
||||
<div id="variable_output"></div>
|
||||
<div id="variable_timestep"></div>
|
||||
<div id="fixed_variable"></div>
|
||||
<!--<button id="basic_start">start</button>-->
|
||||
<!--<button id="basic_stop">stop</button>-->
|
||||
<!--<button id="basic_reset">reset</button>-->
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import 'dart:html';
|
||||
import 'package:browserloop/game/Game.dart';
|
||||
import 'package:browserloop/game/LoopExample.dart';
|
||||
import 'package:browserloop/src/03-FixedLoopVariableRender.dart';
|
||||
import 'package:browserloop/src/04-FixedLoopVariableRender.dart';
|
||||
import 'package:browserloop/src/02-AnimationFrameWhile.dart';
|
||||
|
||||
List<Example> examples = [
|
||||
Example("While Loop Example", "#while_output"),
|
||||
Example("Fixed Update, Variable Render", "#variable_output")
|
||||
Example("Fixed Update, Variable Render", "#fixed_variable"),
|
||||
Example("Variable Timestep", "#variable_timestep")
|
||||
];
|
||||
LoopExample active;
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ void activate(MouseEvent e) {
|
|||
print("#while_output loop added");
|
||||
ex.loop = new WhileLoop(new Game(ex.canvas));
|
||||
break;
|
||||
case "#variable_output":
|
||||
case "#fixed_variable":
|
||||
print("#variable_output loop added");
|
||||
ex.loop = new FixedLoopVariableRender(new Game(ex.canvas));
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue