Jump to content

Performance Issues in Mobile...and im giving up


DonFrag
 Share

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

 

if(sprite.overlap(callbackFunction))

 

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.

Link to comment
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 https://github.com/photonstorm/phaser/blob/master/src/physics/arcade/World.js

 

eg look around line 700 collideSpriteVsGroup:

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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