nomolosvulgaris Posted April 13, 2015 Share Posted April 13, 2015 I want to calculate a distance between object of the platformer and a place it can possibly achieve without moving up or down (face the obstacle or fall down), just left or right. So I use test bodies called this.shadowSide (to watch wall facing) and this.shadowDown (to watch falling). Prefer to call them "shadow bodies". I use this.game.physics.arcade.overlap to determine if the shadow body overlaps the floor. I move shadow bodies (left or right, depending of the direction I need), check overlaps and either continue searching or return a distance. It works well for sprite floors. The trouble is that this.game.physics.arcade.overlap doesn't seem to work with tilemaps. So I am looking for a way to indicate body vs. tilemap overlap. Or to calculate the distance in another way. Did anyone do that?The method with this.game.physics.arcade.overlap used with tilemap (left) and sprite floor (right): http://codepen.io/anon/pen/dPxbJw?editors=001 (use left and right cursor arrows to move bumpers and watch the distance change)The issue with body vs tilemap overlap: http://codepen.io/anon/pen/pvXGWR?editors=001 (I don't know whether or not it is an actual error) Link to comment Share on other sites More sharing options...
Recommended Posts