Close #34 : STEAL_DISTANCE calculation was wacked. This may still cause problems in the future (see note on the issue).

This commit is contained in:
2014-06-29 23:00:11 -07:00
parent 25edfafac1
commit 7932cfea34
2 changed files with 7 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ GameState.prototype.create = function()
pathfinder = new PF.AStarFinder({allowDiagonal: false});
this.physics.arcade.enable(player);
player.body.setSize(16, 16, 8, 16);
player.body.center = new Phaser.Point(player.body.width / 2, player.body.height + player.body.halfHeight);
player.body.collideWorldBounds = true;
//player.body.immovable = true;
@@ -334,11 +335,11 @@ GameState.prototype.update = function()
player.body.y = prevpos.y;
switch ( getFaceState(player) ) {
case STATE_FACE_LEFT: {
player.body.x -= STEAL_DISTANCE;
player.body.x -= (STEAL_DISTANCE + 8);
break;
}
case STATE_FACE_RIGHT: {
player.body.x += STEAL_DISTANCE;
player.body.x += (STEAL_DISTANCE + 8);
break;
}
case STATE_FACE_DOWN: {
@@ -346,7 +347,7 @@ GameState.prototype.update = function()
break;
}
case STATE_FACE_UP: {
player.body.y -= STEAL_DISTANCE;
player.body.y -= (STEAL_DISTANCE * 2);
break;
}
}