mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added reset button
This commit is contained in:
parent
3edd664412
commit
fa2ff0057c
1 changed files with 11 additions and 2 deletions
|
|
@ -28,9 +28,18 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
|
||||||
this.stats = new Stats();
|
this.stats = new Stats();
|
||||||
this.stats.setMode(0);
|
this.stats.setMode(0);
|
||||||
document.body.appendChild(this.stats.domElement);
|
document.body.appendChild(this.stats.domElement);
|
||||||
|
var p = document.createElement("p");
|
||||||
var button = document.createElement("button");
|
var button = document.createElement("button");
|
||||||
button.onclick = inspector.resetLevel;
|
button.innerHTML = "Reset level";
|
||||||
document.body.appendChild(button);
|
button.onclick = function() {
|
||||||
|
inspector.resetLevel();
|
||||||
|
button.disabled = true;;
|
||||||
|
setTimeout(function() {
|
||||||
|
button.disabled = false;
|
||||||
|
}, 1000 * 30);
|
||||||
|
}
|
||||||
|
p.appendChild(button);
|
||||||
|
document.body.appendChild(p);
|
||||||
};
|
};
|
||||||
|
|
||||||
GameController.prototype.destruct = function() {
|
GameController.prototype.destruct = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue