Jump to content

Using Phaser's QuadTree without Physics system?


spinnerbox
 Share

Recommended Posts

Is it possible to use Phaser's QuadTree without enabling the physics system? I don't really need Physics I just want to check if mouse is over a specific tile of a large matrix.

I have a matrix of sprites and it can grow or shrink. Roughly it can have from 70 up to 1500 tiles.

I can use nested "for" cycle to visit each sprite tile and check if mouse cursor is over it but this check happens mostly each update cycle which means 60 frames per second times 1500 checks, that is 90000 checks in the worst case every single second.

Quad Tree uses adjacency tiles to find if mouse is over a specific one. It is more optimized.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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