Tangaroa Posted September 24, 2017 Share Posted September 24, 2017 This has to be a FAQ, but I did not find an answer from a quick search. I will number the questions for reference. 1. If I want a sprite to have a separate collision rectangle that is smaller than the size of the sprite, how is that done in Phaser? 2. What if I want to have more than one collision rectangle for an unusual shape? 3. What if I want to check for collisions with triangles, circles, ellipses, etc? Are there ready-to-go functions for these situations? If not, where would I plug in a handwritten algorithm? 4. If I wanted to have thousands of objects running around a huge map, does Phaser come with an algorithm to cut down the search space for each object's collision detection or is there a good third-party library to use for this situation? Link to comment Share on other sites More sharing options...
samme Posted September 25, 2017 Share Posted September 25, 2017 Arcade.Body#setSize, examples/v2/arcade-physics/offset-bounding-box Use dummy sprites as children. There are a few, check the Geometry classes. You could apply your own in the filterCallback or collideCallback arguments to collide/overlap. Phaser.Physics.Arcade#skipQuadTree Taz and Tangaroa 2 Link to comment Share on other sites More sharing options...
Recommended Posts