Seems like there was a lot of posts asking how to add actions to a sequence dynamically. So I wrote a function that you can add to IntervalAction.m and header that'll take a NSMutableArray of actions as the parameter:
+(id) actionMutableArray: (NSMutableArray*) _actionList {
FiniteTimeAction *now;
FiniteTimeAction *prev = [_actionList objectAtIndex:0];
for (int i = 1 ; i < [_actionList count] ; i++) {
now = [_actionList objectAtIndex:i];
prev = [Sequence actionOne: prev two: now];
}
return prev;
}
So to use this, just create an NSMutableArray of actions that you want sequenced, then pass it to the actionMutableArray function.
NSMutableArray* actionList = [[NSMutableArray alloc] initWithCapacity:1];
[actionList addObject:yourActionOne];
[actionList addObject:yourActionTwo];
[actionList addObject:yourActionThree];
[yourSprite runAction:[Sequence actionMutableArray:actionList]];
This seems to run faster than using:
-(id) addAction:(id) _action ToSequence:(id) _seq {
return [Sequence actions: _seq, _action, nil];
}