Jump to content

Sprites touching each other on near position.


zajca
 Share

Recommended Posts

Hi, 

I'm looking for way how to check distance between two sprites based on their borders not anchors.

 update: function(){        var self = this;        if(this.dragging){            this.tileGroup.forEach(function(tile){                var distance = self.game.physics.arcade.distanceBetween(self.draggedTile, tile);                if ( distance < 85 && distance > 75 ) {                    console.log(distance);                }            });        }    }

this will check distance between anchors of dragged tile and other tiles but not based on their shape.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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