Hey developers, I got a problem. I want my "soucoupe" sprite to go first to the right edge of the screen and i want it to increase its .y position at the same time, after that, I want my sprite to go to the left edge of the screen and increasing its .y position this time too. I want it to repeat this action forever. So, I tried to to it, here is my code :
soucoupe = [CCSprite spriteWithFile:@"Soucoupe.png"];
soucoupe.position = ccp(size.width/2, size.height/2);
[self addChild:soucoupe z:1 tag:kTagSoucoupe];
id actionMoveRight = [CCMoveTo actionWithDuration:1.5 position:ccp(320-soucoupe.contentSize.width/2, soucoupe.position.y)];
id actionMoveLeft = [CCMoveTo actionWithDuration:1.5 position:ccp(0+soucoupe.contentSize.width/2, soucoupe.position.y)];
id actionMoveUp = [CCMoveTo actionWithDuration:5 position:ccp(soucoupe.position.x, size.height+soucoupe.contentSize.height/2)];
id actionMoveRightUp = [CCSpawn actions:actionMoveRight, actionMoveUp, nil];
id actionMoveLeftUp = [CCSpawn actions:actionMoveLeft, actionMoveUp, nil];
[soucoupe runAction:[CCRepeatForever actionWithAction:[CCSequence actions:actionMoveRightUp, actionMoveLeftUp , nil]]];
May I change it ? Did I do something wrong ? Thanks in advance for your help !