Panayoti over at Urban Squall runs a fantastic blog called Game Poetry, there he posts great advice on all things for Flash gaming. One of his posts found here is about improving performance with animated bitmaps. In a nutshell it describes a code project that he has started up to create and manage bitmap animations from a sprite sheet. At the end of the post he sent out a call to developers to help him out with specification for external data for creating animations. I helped out and came up with my own, however it is now dated.
Despite that I am encouraging you to check out the blog post and the project to whom ever wants a simple and clean implementation of managing animated bitmaps in your games or apps. You can check out my implementation here.
Basically all that is happening in this example project is under the trycatchgames folder is my implementation of Urban Squall’s bitmap animation framework, which has since been updated. In the Main class you can see how I am using XML to define an animation, create it using the animation builder, add it to the controller and play it. By using the unified animation controller we are able to add one to many bitmap animations and retrieve them when needed. It should also be noted that even if you don’t have rotation in your sprite sheet that you are able to add rotation if you so desire. On bitmap animation creation you are able to specify the number of degrees in your rotation.
Check out the example project and the newest one in the Urban Squall code repo found here.