Sprite sheet or multiple resources
Someone asked on Game Development:
When animating for the Android platform is it a better practice to create a sprite sheet with multiple states for each sprite on a single picture or should I instead export individual images for each character/state/etc.? Which option gives me a smaller file size for resources and which is easier for the programmer to animate?
I posted the following answer, which was chosen as the accepted answer and received 4 upvotes:
It depends how many you have and how many of those would be in use at any given time.
I would break it down as follows:
For each “sprite” I would have one sheet, each WxH section is a single frame. If there are only a few states, I’d keep those all in the same image file, and just make a map of
- Walking is sprites 0-9
- Jumping is 10-15
- Crouching is 15-20
If you have many states per sprite, I would consider breaking up each state animation into its own file.
If you only have a few sprites and a few states, it might be best to simply have it all on a single image file, and use the maping I have above, but include it per sprite. This will keep the amount of memory usage to a minimum, since you’re targeting android, memory is a premium resource and should be conserved where possible.
Originally posted on Game Development — 4 upvotes (accepted answer). Licensed under CC BY-SA.