Jump to content

Get entities at x,y location


oxysoft
 Share

Recommended Posts

A quick way to do it would be something like this:

function getSpritesAtXY(group, x, y) {  var location = new Phaser.Point(100, 100);  var found = [];  group.forEachExists(function(sprite) {    if (Phaser.Rectangle.contains(sprite.getBounds(), location)) {      found.push(sprite);    }  });  return found;};
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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