Skip to content

Commit

Permalink
adding a bit of fudge factor to the platform detection
Browse files Browse the repository at this point in the history
  • Loading branch information
pwmckenna committed Feb 8, 2013
1 parent a80bac1 commit d7eb0bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/scripts/mduel/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ var definePlayer = function(
var playerCenter = this.getPositionX() + 32;

var predX = function(p) {
return playerCenter >= p.x && playerCenter <= (p.x + 32);
var CLING_FACTOR = 1;
return playerCenter >= p.x - CLING_FACTOR &&
playerCenter <= (p.x + 32) + CLING_FACTOR;
};

var columnPlatforms = Mduel.Util.where(Mduel.Game.stage.platforms, predX);
Expand Down

0 comments on commit d7eb0bc

Please sign in to comment.