I generate the length of the maps randomly, adding to the main Sprites chaild sprite, as a result of my fall FPS and everything slows down.
Can I use a sprite many times it does not allocate memory.? Code looks like this:
int z = rand % 10;
for (int i = 0; i < z; i++)
{
CCSprite *waterLenght = [CCSprite spriteWithFile:@"water.png"];
waterLenght.position = ccp([waterStart boundingBox].size.width +20*i, 0);
[waterStart addChild:waterLenght];
}
[self addChild:waterStart];
Yes. If you create multiple instances of CCSprite using the same image, the image will be loaded into memory as a texture only once.