kriket Posted November 2, 2015 Share Posted November 2, 2015 I am keeping my game lean and be ale to run on mobile, and so I am not using any physics, and checking overlap with checkOverlap: function(spriteA, spriteB) { var boundsA = spriteA.getBounds(); var boundsB = spriteB.getBounds(); return Phaser.Rectangle.intersects(boundsA, boundsB); },However, just like we can set body size to get more accurate collisions/overlaps, I want to be able to define such a "hitArea" for plain sprites. Is it possible to do this? Link to comment Share on other sites More sharing options...
in mono Posted November 2, 2015 Share Posted November 2, 2015 You can extend Phaser.Sprite, add a rectangle as a property, then use that rectangle (and not sprite._bounds) to check for overlap. That's the cleanest way I can think of. kriket and Skeptron 2 Link to comment Share on other sites More sharing options...
Recommended Posts