Celebrating 10000 views with a gift for you all! Thanks for the support!
A new day and a new feature that I've been wanting to do for a while.
I did something awesome! Since I'm lazyI like to get results ASAP and I'm quite not planning to do a death animation for each one of the characters, I worked a bit on something I'm planning to share today, which is an automatic ragdoll generator
Basically, the way it works is really simple. Here are its features:Grabs any spine skeleton and clones its parts. Physics bodies will have the image dimensions and the proper image itself. Scaling of said skeleton is supported. Position of the limbs will respect the original positions of each image (so it doesn't pop up). Facing left|right is supported-ish. Supports body parts replacements. So, if you want to use a damaged head, or a damaged torso, you can do so.
I don't have time to do a proper tutorial, but basically, you have to expose FlxSpine::getSprite() and create new string name in FlxSprite. A bit hacky, but works!cloneSlot("larm"); cloneSlot("rarm"); cloneSlot("body"); cloneSlot("head_dead"); tieTogether("head_dead", "body"); tieTogether("larm", "head_dead", new Vec2(0, -30), new Vec2( -110, 100)); tieTogether("rarm", "head_dead",new Vec2(0,-40),new Vec2(90,70));
Now that I think of... isn't that automatic, since requires to setup what you want to clone and where the libs are tied together. This should grab the position of the Spine bones. I attempted to do so, but it would need some tweaks because not all bones were created with this in mind.
Well, that's it for now. Hope you enjoy this, in the case you are using skeletal animation in your characters it will be super useful.
Suggestions or improvements are very welcome!