Jump to content

Calculating horizontal distance with arcade tilemaps


nomolosvulgaris
 Share

Recommended Posts

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?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...