Fix #34 : undefined reference was due to abuse of game.rnd.integerInRange out of bounds

This commit is contained in:
2014-07-06 15:48:27 -07:00
parent 63ed93a653
commit 3e27b50a80
2 changed files with 5 additions and 3 deletions

View File

@@ -332,6 +332,8 @@ GameState.prototype.update = function()
if ( hasState(player, STATE_STEALING) == true &&
x.sprite_has_treasure == true ) {
var prevpos = player.body.position;
var prevwidth = player.body.width;
var prevheight = player.body.height;
player.body.position = new Phaser.Point();
player.body.x = prevpos.x;
player.body.y = prevpos.y;
@@ -390,6 +392,8 @@ GameState.prototype.update = function()
rs.fixedToCamera = true;
}
player.body.position = prevpos;
player.body.width = prevwidth;
player.body.height = prevheight;
}
}