Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a character which can hold ten types of weapons.

Should I:

  1. Create ten sets of animations for the character with each weapon
  2. Create animations for each weapon, and programmatically draw them on the character

Option 1 is simpler in general, but requires more work on the artist, and results in larger game size.

Option 2, to me, is a programming nightmare...

Whats the better practice in general? Thanks.

share|improve this question
up vote 5 down vote accepted

Unless you have a high frame rate and very low size requirements, the number of sprites you're talking about won't matter compared to, say, the audio files (especially music!). If game size was the only requirement, I'd say go with pre-baked animations.

As long as you only have ten weapons, either way will be roughly the same amount of work for the artist; I'm assuming she'll be reusing most of the character animations and only changing a bit for each weapon.

If you have combinations of items, then Option 2 becomes more appealing. If you have, say, 10 weapons and 4 armors that can be worn in combination, you suddenly have the choice between 40 animations or combining 14 programmatically. If you add 10 hats, it's 200 versus 24. Combinations of items is the most common reason I've seen that developers programmatically layer sprite animation.

So I say you might as well go for Option 1 unless you're combining stuff.

As an aside, though, the code for layering sprites shouldn't be too hard if you're using a decent library or framework. The fact that it seems intimidating may show a weakness in your development skills. It might be worth it to expand your programming knowledge by treating this as an exercise.

share|improve this answer
Ok got it, thanks! – david oliver Sep 16 '12 at 15:57
If this answered your question make sure you mark it as accepted. – iQue Sep 16 '12 at 17:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.