The only way to do it is by doing a complex system on top of sprites, polygons will be the easiest and better performant way.
To do that you will need to pick every single pixel on the image data, translate to world position, and compare against the position of every single pixel on the other image.
Usually, this is not needed in games (and less with animated things), it do not offer anything to the players and perfection can be annoying to them too (plus the low performance of that kind of check), is generally better to do rough polygon or simple boxes, always favoring the gameplay, and work with that.
Bodies and areas can have many shapes, and use some of these shapes can be related to the animations, for shape comparison when the bigger box of the 2 elements is overlapping.
I agree with this. Usually a bounding box is preferable and perfectly good enough, even if the sprite is animated. Sometimes the BB animates to accommodate to the frames, and sometimes that’s not necessary.
I wonder, though: I know CollisionShape2Ds can be animated, as far as position, rotation, etc, go, and I suppose CollisionPolygons can be animated too, but I never tried animating their actual vertices. I wonder if that can be achieved, as that might be a solution for the OP.
woopdeedoo | 2018-05-15 22:53
CollisionPolygons can be animated but the physics server may not notice it fast enough for detections, also the polygon making may get glitchy, a convex polygon shape may be better but the use is limited.