Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.