Jump to content
  • Advertisement
Sign in to follow this  
Whorse

Approaching multiple animation support per sprite

This topic is 2527 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I using a similar method to this to animate my sprites currently:

http://www.sdltutorials.com/sdl-animation

I'm now looking to add in multiple animation support per sprite, and am interested on getting your thoughts as to what the best way to approach this would be. Looking forward to hearing your thoughts and suggestions!

Share this post


Link to post
Share on other sites
Advertisement
When you have multiple animations you basically do the same thing, but you have to make a map (in the mathematical sense of a mapping) between you animations and the sprites in your texture atlas. This mapping can be as simple as an offset in the image index and the number of frames in the animation (not that you may also need to define transitions between different animations).

Share this post


Link to post
Share on other sites
That's what I was thinking would be the best idea. Simply offset the beginning and ending animation index and loop accordingly. Is this the most commonly used and clean way of doing it out of interest?

Share this post


Link to post
Share on other sites
I think it depends on the features you want to implement and how much animations do you have for a single entity. You may for example want to support sprites of different sizes and therefore not aligned to a grid or maybe store the animations in different files or give several variations for a single animation (and choose randomly the variation to use) or you may want to attach other data to the animation (like sounds or particle systems).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!