Is there a way to reverse frame order in sprite sheet animations?

Basically I have the following line of code:

sprite.add( spriteSetPlayer, "hit", 7, 4, 500, 0 );  

And I want to have an animation that starts from frame 10 and goes down to frame 7. I don’t want it to go from frame 10 and wrap around back to 1.

Is this possible? [import]uid: 116225 topic_id: 20977 reply_id: 320977[/import]

Yes, this should be possible (just a little more tricky to set up) using the “multi set” sprite API versus the standard set API. Despite what the documentation says, you don’t need to use multiple sprite sheets. You can pull all frames from the same sheet but this API allows you to define very specific orders of frames, while the traditional is the simple “start frame / number of frames in forward direction”. Also, you don’t need to pull frames from “data” as shown in the example code. A few users have posted other examples which should help you through the entire setup.

http://developer.anscamobile.com/reference/index/spritenewspritemultiset

Best of luck
Brent Sorrentino
Ignis Design [import]uid: 9747 topic_id: 20977 reply_id: 82884[/import]

Another way to do this is to duplicate the frames in reverse order in your data sheet and give them a different name from the original sequence. Note that this may not be the easiest to maintain if your sprite sheet is not in a finalized state. If your sprite sheet isn’t finalized or you’re not using a tool that will handle the duplicate frames for you Brent’s suggestion is the way to go. [import]uid: 100558 topic_id: 20977 reply_id: 82944[/import]

Thanks for both your comments,

I was thinking about doing it how you suggested Licensing, but I just thought there must be another way. My game is setup at the moment all using single set sprite sheets so I think I will go with duplicating in reverse order for now. Once I’ve fixed up some bugs in the game, I might clean up some of this code using multiset’s it seems much cleaner. [import]uid: 116225 topic_id: 20977 reply_id: 83036[/import]