From fa2ff0057c519d33c1093a6a0090a810f24011d9 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 12 Jan 2014 04:58:22 +0100 Subject: [PATCH] added reset button --- app/Game/Client/GameController.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index f1a6bc9..35b8003 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -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() {