In my game I want to have two backgrounds going one after the other creating a continuous loop moving to the left. However, right now one goes, and the other does not follow it.
Here's what I currently have, which isn't working.
if((self = [super init]))
{
self.isTouchEnabled = YES;
background=[CCSprite spriteWithFile:@"testbackground88.png"];
[self addChild:background z:1];
background.position=ccp(500,240);
id repeat1 =[CCRepeatForever actionWithAction:[CCSequence actions:
[CCMoveTo actionWithDuration:7 position:ccp(-300,240)],
[CCPlace actionWithPosition:ccp(800,240)],nil]];
[background runAction:repeat1];
background2=[CCSprite spriteWithFile:@"testbackground92.png"];
[self addChild:background2 z:1];
background2.position=ccp(500,240);
id repeat2 =[CCRepeatForever actionWithAction:[CCSequence actions:
[CCMoveTo actionWithDuration:7 position:ccp(-300,240)],
[CCPlace actionWithPosition:ccp(800,240)],nil]];
[background2 runAction:repeat2];
}