Remove debug and add some neat stuff

Try to find the problem where the game hangs after room change
This commit is contained in:
Aaron Fischer 2017-09-13 23:27:19 +02:00
parent 09cff3ab3b
commit 2af84112e1
3 changed files with 4 additions and 8 deletions

View file

@ -17,7 +17,7 @@
mouseSprite.y = Math.floor(evt.offsetY/8); mouseSprite.y = Math.floor(evt.offsetY/8);
} }
// DEBUGGING PURPOSE // DEBUGGING PURPOSE
console.log(mouseSprite.x, mouseSprite.y); //console.log(mouseSprite.x, mouseSprite.y);
}; };
canvas.addEventListener('click', clickEvent); canvas.addEventListener('click', clickEvent);

View file

@ -72,15 +72,12 @@
'You? No!', 'You? No!',
]); ]);
var no = Math.floor(Math.random()*10); var no = Math.floor(Math.random()*10);
console.log(no);
if (no > 4) { if (no > 4) {
muri.get('bubble').talk([noMessage]); muri.get('bubble').talk([noMessage]);
} else { } else {
muri.get('bubble') muri.get('bubble')
.talk([goMessage]) .talk([goMessage]);
.then(function() { setTimeout(function() { muri.changeRoom(room); }, 800);
muri.changeRoom(room);
});
} }
}); });
e.sprite.playAnimation('off'); e.sprite.playAnimation('off');

View file

@ -37,14 +37,13 @@
.create('stasis.liftSwitch'+i, liftSwitch) .create('stasis.liftSwitch'+i, liftSwitch)
.addCallback(function() { .addCallback(function() {
toggleLiftSwitch(i); toggleLiftSwitch(i);
muri.get('bubble').talk(['Click'], [85, 19]);
var randomSwitch = Math.floor(Math.random()*roomState.liftSwitches.length); var randomSwitch = Math.floor(Math.random()*roomState.liftSwitches.length);
if (randomSwitch !== i) if (randomSwitch !== i)
toggleLiftSwitch(randomSwitch); toggleLiftSwitch(randomSwitch);
var solved = true; var solved = true;
console.log(roomState.liftSwitches);
roomState.liftSwitches.forEach(function(s) { roomState.liftSwitches.forEach(function(s) {
console.log(s);
if (s === 'off') solved = false; if (s === 'off') solved = false;
}); });
if (solved) { if (solved) {