From 2af84112e107638ff86177f22e6384f2282100e4 Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Wed, 13 Sep 2017 23:27:19 +0200 Subject: [PATCH] Remove debug and add some neat stuff Try to find the problem where the game hangs after room change --- src/mouse.js | 2 +- src/room_lift.js | 7 ++----- src/room_stasis.js | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/mouse.js b/src/mouse.js index 972f7f6..94e89f8 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -17,7 +17,7 @@ mouseSprite.y = Math.floor(evt.offsetY/8); } // DEBUGGING PURPOSE - console.log(mouseSprite.x, mouseSprite.y); + //console.log(mouseSprite.x, mouseSprite.y); }; canvas.addEventListener('click', clickEvent); diff --git a/src/room_lift.js b/src/room_lift.js index 80e59bc..4f1a8ff 100644 --- a/src/room_lift.js +++ b/src/room_lift.js @@ -72,15 +72,12 @@ 'You? No!', ]); var no = Math.floor(Math.random()*10); - console.log(no); if (no > 4) { muri.get('bubble').talk([noMessage]); } else { muri.get('bubble') - .talk([goMessage]) - .then(function() { - muri.changeRoom(room); - }); + .talk([goMessage]); + setTimeout(function() { muri.changeRoom(room); }, 800); } }); e.sprite.playAnimation('off'); diff --git a/src/room_stasis.js b/src/room_stasis.js index ad8887d..e310b06 100644 --- a/src/room_stasis.js +++ b/src/room_stasis.js @@ -37,14 +37,13 @@ .create('stasis.liftSwitch'+i, liftSwitch) .addCallback(function() { toggleLiftSwitch(i); + muri.get('bubble').talk(['Click'], [85, 19]); var randomSwitch = Math.floor(Math.random()*roomState.liftSwitches.length); if (randomSwitch !== i) toggleLiftSwitch(randomSwitch); var solved = true; - console.log(roomState.liftSwitches); roomState.liftSwitches.forEach(function(s) { - console.log(s); if (s === 'off') solved = false; }); if (solved) {