Jump to content

Check if my sprite has been overlapped by any sprites in this group


My Evil Pony
 Share

Recommended Posts

You can pass a group as the arcade physics overlap function. https://photonstorm.github.io/phaser-ce/Phaser.Physics.Arcade.html#overlap

That said, you need arcade physics on all sprites within the group as well as the sprite you want to check against the group.  If you feel you don't need physics on the group's sprites, check this example:  https://www.phaser.io/examples/v2/sprites/overlap-without-physics

Also, for future reference, you can forEach any group do custom work on each of its elements independently, just like a vanilla javascript array.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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