Jump to content

Add sprite to group on overlap


mariogarranz
 Share

Recommended Posts

I have a sprite and a group of sprites, and i want to make it so that if the sprite does ever overlap with any of the group sprites, it will be added to that same group.

The thing is, if I do this addittion in the overlapCallback, the game enters an infinite loop, which I guess is happening because the Arcade physics system does still have more sprite overlaps to check before considering the whole group overlap verified, but at this point the sprite itself is also part of the group being checked against.

Is there any easy way to let the Arcade system stop permorming overlap checks once it finds the first one?

Otherwise I guess I will have to perform this addition after the overlap check is completely finished, though I'd prefer the first option.

Thanks :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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