I am a beginner to cocos2d and trying to implement a jumping game and have a question how to scroll enemies that have actions when the player jump up the screen. The problem I am having is that when I add actions such as the below and then in my step: i move the enemies down the screen when player jumps up but after running actions the
[enemySprite setPosition:newPos];
doesn't do anything anymore. I searched all over forums and google and can't seem to find an answer and would appreciate the help. Thanks.
- (id)enemyActionSlide
{
NSLog(@"Action Slide");
static float duration = 1.5f;
id actionLeft = [CCMoveBy actionWithDuration:duration position:ccp(-30,0)];
id actionRight = [actionLeft reverse];
id actionSeq = [CCSequence actions:actionLeft, actionRight,nil];
id actionFull = [CCSequence actions:actionSeq,[actionSeq reverse],nil];
id action = [CCRepeatForever actionWithAction:actionFull];
return action;
}