added reset button

This commit is contained in:
Jeena 2014-01-12 04:58:22 +01:00
parent 3edd664412
commit fa2ff0057c

View file

@ -28,9 +28,18 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
this.stats = new Stats();
this.stats.setMode(0);
document.body.appendChild(this.stats.domElement);
var p = document.createElement("p");
var button = document.createElement("button");
button.onclick = inspector.resetLevel;
document.body.appendChild(button);
button.innerHTML = "Reset level";
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() {