Best Practice for Hero sprites - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Best Practice for Hero sprites (/thread-10446.html)
Best Practice for Hero sprites - mravkata - Nov 26, 2012 02:51 PM
Hello, I develop game where main character will change guns ...
So i wonder what is best practice for sprite ?
I think of somthing like that :
Separate body from arms . So i'll have one sprite sheet for body - animated ( move left and right ) ,
and one for arms whit diffrent wepons. And i'll atach arms to body ...
I'll be glad if u share ideas or expiriance what is the best method to acomplish this .
RE: Best Practice for Hero sprites - SethWillits - Nov 26, 2012 05:54 PM
Weapons might also change the character's foot pattern. A gigantic rocket launcher might mean the player can't run like they can with a small pistol, and rather than simply slowing down the running animation you might want to have a smaller stride to look more accurate. That would mean having at least having a separate sheet for the body for different movement speeds, but perhaps you simply want to tie it to each weapon for simplicity's sake.
The character could have a different facial expression with each weapon, too...
Simply duplicating the entire sprite sheet and swapping out the weapon is easiest for you as a programmer, but it'll also waste time swapping sprite sheets or VRAM by trying to keep them all in memory.
Keeping each body part separate could be useful (change walking stride, or facial expressions, or the player's clothes etc independent of everything else), but it will require more work up front to group the sprites together at runtime with the necessary movement.
For example, do you have exactly one image for a leg and simply have it pivot and move like it should, or are you going to have 10 leg images each at different point in the stride, so the positioning is all done at the time the images are created? The latter is simpler, but wastes RAM again…
Pick your poison.