Multiple images for FlxSprite animations

164 views
Skip to first unread message

puggsoy

unread,
Sep 10, 2014, 4:03:42 AM9/10/14
to haxef...@googlegroups.com
I'm wondering if it's possible to give a FlxSprite animations using frames from separate images. I'd only want to have separate animations use different images, not one animation have frames from multiple images.

For example, suppose I have two enemies, Rat and Croc, with each of their frames in separate image strips, rat.png and croc.png. However I want them both to use the same death animation, an explosion which has its frames located in common.png. Is it possible for them to have most of their animations take frames from their respective images, yet grab their death animation frames from common.png?

Gama11

unread,
Sep 10, 2014, 5:33:37 AM9/10/14
to haxef...@googlegroups.com
I don't think so, no. You could create a new BitmapData that contains all the animation frames via code.

puggsoy

unread,
Sep 10, 2014, 6:38:57 AM9/10/14
to haxef...@googlegroups.com
Ah OK, that's probably the best solution then. Maybe I can extend FlxSprite and automate such a feature, that would be pretty cool.

SruloArt

unread,
Sep 10, 2014, 10:03:47 AM9/10/14
to haxef...@googlegroups.com
Let's not forget this still exists (probably needs some work):
https://github.com/HaxeFlixel/flixel/pull/710

Sergio

unread,
Sep 16, 2014, 2:12:11 AM9/16/14
to haxef...@googlegroups.com
FlxMultiSprite is for cases when you have more animations for a sprite than can fit in spritesheets for older devices (1024x1024 and less).we needed this functionality for Times Ninja because there Ninja has a lot of combo animations. It seems that in most games it's not needed. Now in my programs I'm behind dev version, if people need that to be added to Addons I'll add it, but I think a demo also must be made which will show how to use it, for that demo I'll need a open source character  with animations spread to different spritesheets. If you can point it - it will be great.

Gold_Ninja

unread,
Sep 16, 2014, 2:26:56 AM9/16/14
to haxef...@googlegroups.com
I would solve this by having the death-anim/explosion be a separate sprite and just swapping out the dead Rat with the explosion sprite when the rat gets killed.
Reply all
Reply to author
Forward
0 new messages