Hi everybody,
in my game I have a character with a lot of different animations. The size of the character is about 350x350 px, so the sprite sheets i build with TexturePacker easily raise the 2048x2048 marker. I would like to know, what is the best way to handle this problem.
My first idea was to generate different spritesheets and load them in different Batch Nodes. But if i do so I have to add multiple sprites for only 1 character.
batchnode_A = cocos2d::SpriteBatchNode::create("spritesheet_A.png");
batchnode_B = cocos2d::SpriteBatchNode::create("spritesheet_B.png");
cache->addSpriteFramesWithFile("spritesheet_A.plist");
cache->addSpriteFramesWithFile("spritesheet_B.plist");
sprite_A = cocos2d::Sprite::createWithSpriteFrameName("spriteframe_A1.png");
sprite_B = cocos2d::Sprite::createWithSpriteFrameName("spriteframe_B1.png");
batchnode_A->addChild(sprite_A);
batchnode_B->addChild(sprite_B);
layer->addChild(batchnode_A);
layer->addChild(batchnode_B);
if I move the character I have to move all sprites. And if I want to play an animation from spritesheet_A I have to set sprite_A visible and all other sprite_X invisible.
Is that the only way to handle lot of animations for only 1 character?