Performance Issues in Mobile...and im giving up

Recommended Posts

if would be a way to add a sprite a collision check (not the body, the sprite) to any object and then heck if it is a block or whatever , that would be the solution

something like




and inside callback check anything


the sprite overlap examples and functions demands two objects. or one in the case of sprite.overlap. in any case case it demands to know the second object to test, and that, in this case, i don't know.


i tried to check with a for every block in the array where they are stored and compare the overlap, but this is way too expensive in any case inside in a update.

Share this post

Link to post
Share on other sites

i think sprite vs group uses some kind of internal optimsation to not have to check every sprite in the group.. since some will be too far anyway. same with group vs group... 


I've not checked those routines specifically as to how, but for instance i checked vs sprite vs tilelayer code and that only checks tiles around the sprite... the ones that it *could* be colliding with


actually you can see in here it uses a QuadTree


eg look around line 700 collideSpriteVsGroup:

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.