ios - How to leverage CCSpriteBatchNode when frames are distributed into multiple textures -


In my game, there are lots of enemies (subclass of CCNode ) which are animation frames Distributed in many texture files (enemy01.png, enemy 02.png ...) and enemies can be generated from different textures in the same scene.

I want a unified way to dynamically add to the enemy randomly generated on the correct CCSpriteBatchNode , but a lookup table does not look so elegant. Is there any better way to handle it?

Thanks

Since each enemy uses its textures, Can use a phantom batch node for Therefore, when you make the enemy "X", even when you store it (perhaps an NSDictionary), it should not be difficult to obtain a phantom batch node.

Keep in mind that Texture Atlas is small for each enemy due to enemy type per phantom batch node and maximum allowed size (1024x1024 for older devices, iPhone 3GS and newer 2048x2048 or greater) Not close. If possible, order multiple images in a texture atlas and use a phantom batch node for it.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -