Here’s how I would do it:
-
Build your physics shapes in PE using the individual images, not the spritesheet.
-
Code your game to use the sprite sheet. Then you have several options:
2a. Add multiple physics bodies to the same sprite, one for each frame of animation. BUT deactivate all but the current frame - use a “sprite” type event listener to sync the physics bodies to the animation frame. I have never tried this, so I don’t know how it affects density - you probably set the gravity of all the inactive bodies to 0.0 upon initialization and every frame change. I don’t think inactivating bodies nullifies their density though, so you might want to divide the desired total density by the number of bodies you’re using. Let me know how that works out.
2b. Make one body with multiple shapes to cover every frame of animation, but in the PreCollision listener, test event.element1 and/or event.element2 to see which shape is being collided with. If it’s the wrong one for the animation frame you’re playing, (current frame is accessible as a sprite property) then you can set event.contact.isEnabled = false and it will act as if that particular shape on the body never touched the other object.
There are a few other ways to try it, but I would try one of those first.