I am building a cocos2d iPhone game.
There will be 6 'enemy spaceship sprites' that vary only by colour. I.e. all the sprites will have the same shape only some parts of the interior will have different colours.
My two options are:
1)
- Create a template shape with a transparent interior.
- At runtime, draw this shape on top of a small block of colour X.
- The interior of the sprite will be colour X.
2)
- Pre-render 6 different sprites
- At run time, simply draw the sprite of a given colour.
What is the advantages and disadvantages of each method? Is there a best practice?
If I later wanted to animate the sprites, or dynamically change their colours, would this effect my choice of method?
Thanks!