My Evil Pony

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

Recommended Posts

Need to check not only collision. There is important difference beetwen sprites, that have been overlapped, and sprites, that have overlapped another sprites. Im my task i need to check if my sprite had been overlapped by any another sprite. 

Share this post

Link to post
Share on other sites

You can pass a group as the arcade physics overlap function.

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:

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.