diff --git a/lib/impact/collision-map.js b/lib/impact/collision-map.js index 23f5dde..d8cf34a 100644 --- a/lib/impact/collision-map.js +++ b/lib/impact/collision-map.js @@ -90,9 +90,10 @@ ig.CollisionMap = ig.Map.extend({ for( var tileY = firstTileY; tileY < lastTileY; tileY++ ) { if( prevTileX != -1 ) { t = this.data[tileY][prevTileX]; - if( - t > 1 && t <= this.lastSlope && - this._checkTileDef(res, t, x, y, rvx, rvy, width, height, prevTileX, tileY) + if( + t > 1 && t <= this.lastSlope && + this._checkTileDef(res, t, x, y, rvx, rvy, width, height, prevTileX, tileY) && + res.collision.slope.ny !== 0 ) { break; } @@ -137,9 +138,11 @@ ig.CollisionMap = ig.Map.extend({ for( var tileX = firstTileX; tileX < lastTileX; tileX++ ) { if( prevTileY != -1 ) { t = this.data[prevTileY][tileX]; - if( + if( t > 1 && t <= this.lastSlope && - this._checkTileDef(res, t, x, y, rvx, rvy, width, height, tileX, prevTileY) ) { + this._checkTileDef(res, t, x, y, rvx, rvy, width, height, tileX, prevTileY) && + res.collision.slope.nx !== 0 + ) { break; } }