I'm making a game sprite, with animations for transitioning to different states, such as idle, sleeping, etc. I'm wondering what the most efficient way to play the animations is. As of now, I have a couple of ideas:
- store all frames as separate PNG images, and display only the frames for the current state (e.g. play frames 1-5 for idle, 5-10 for transitioning, 10-15 for sleeping)
- make the animations into GIFs and play the one corresponding to the current state.
- merge them all into a spritesheet.
Please let me know which would be the best approach, or if there's a better way to do things. I'm new to handling images and animation with code, so I'm not sure what the advantages and disadvantages are. Thanks!
In case the information helps anyone, I'm planning to use Python for this (although I could also do Java or C++, if there are good solutions in those languages), and the sprite image size isn't large, it's pixel art.