Remove debug and add some neat stuff
Try to find the problem where the game hangs after room change
This commit is contained in:
parent
09cff3ab3b
commit
2af84112e1
3 changed files with 4 additions and 8 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue