What's your best practices?

I’m making a game with zombies and guns, lots of guns. I haven’t found any ‘detailed’ tutorials on games and the little stuff that makes big differences. I have around 50 guns. Do I need to make separate sprite sheets for each player with each gun? Or just have the player sprites with the gun like “player.x + 50” or? And with multiple character actions, do I need a sprite sheet for each action, or can I put them all in one? [import]uid: 114389 topic_id: 28965 reply_id: 328965[/import]

i’ll try to help with as much as i can…

for some tutorials you can check out go to -http://www.learningcorona.com/-
also look at the sample code and such for a little demonstration.

what i would do is first draw out one picture of each gun and player. I would then separate the guns into different sizes and looks so what i mean is that you can have the same player image for multiple guns as long as all the guns in that group have similar actions/sizes -such as 2 similar pistols

the player.x+50 should work fine but it would take some work to get the player/gun in sync

you can put each sprite sheet into one i usually use a row for each action and have a couple sheets containing similar things, just to clean things up a bit but it can all be on one as long as isn’t to huge.

remember to start small and work your way up, no need to do something 50+ times only to find it doesn’t work and have to start over.

-boxie
[import]uid: 113909 topic_id: 28965 reply_id: 116613[/import]

Definitely a good idea to separate the animations in different sprite sheets; then construct them in the code with offsets.

I’ll use Metal Slug as an example to illustrate.

Take a look at these sprites of Marco running

You’ll see that the sprites are separated based on upper and lower body - as the legs have 18 frames; whereas the torso only has 12. This gives a bit of flexibility in animating, as the character’s torso doesn’t need as many frames as the legs - this method allows you to easily loop the torso and leg animations separately; then simply align them in the code with offsets; something like
torso.y = legs.y - 10; or something like that.

You’ll also see that the torso has different sprite sets based on which gun that the character has equipped. This also makes things easier, as the legs are able to be reused for each different gun. If the legs and torso were combined in the sprite sheets, not only would you have trouble with the fact that the torso and legs animations don’t have the same number of frames; but you’d constantly be wasting pixels in your sheets rendering the same legs over and over again for each different torso + gun animation when you didn’t need to.

This is the kind of thing you want to be doing with your sprite sheets - it’ll save both memory of image sizes and make your animations a little easier to plan and draw for each different gun and character. I hope that example helped! [import]uid: 144339 topic_id: 28965 reply_id: 116809[/import]