hi,
i want to display 5images based on the level . for example there are 5 images named image1.png,image2.png...image5.png.when the level value set to 3 need to display 3 images on the screen. so i used NSMutableArray to create CCSprite object . now how to display that images.
pleae help me
i want to display 5images based on the level . for example there are 5 images named image1.png,image2.png...image5.png.when the level value set to 3 need to display 3 images on the screen. so i used NSMutableArray to create CCSprite object . now how to display that images.
Code:
int i,endvalue=3;
NSMutableArray *levelStar = [ [NSMutableArray alloc] initWithCapacity:9 ];
for(i=1;i<=endvalue;i++)
{
CCSprite *star = [CCSprite spriteWithFile:@"image"+i+".png"];
star.position = ccp( 80+(i*10),60+(i*10));
[levelStar addObject:star];
[self addChild:star];
}
pleae help me