I have 6 menu items on my screen that I want to slide off the screen one by one after the help button (one of the 6 items) is clicked. Here's my code:
NSArray * menuArray = [NSArray arrayWithObjects:item1, item2, item3, item4, item6, item5, nil];
CCDelayTime * delayM = [CCDelayTime actionWithDuration:1.4];
for (CCMenuItem * item in menuArray) {
id moveLeft = [CCMoveBy actionWithDuration:0.7 position:ccp(10, 0)];
id moveRight = [CCMoveBy actionWithDuration:0.4 position:ccp(-200, 0)];
//CCDelayTime * delayM = [[CCDelayTime alloc] initWithDuration:1.4];
[item runAction:[CCSequence actions:moveLeft, moveRight, delayM, nil]];
}
For some reason, the delay doesn't seem to make any difference here and all of the menu items slide off the screen at the same time. How can I make it so that the menu items won't slide off the screen until the last one already has?
Sidenote: I can't figure out how to cancel all of the selectors that these menu items are hooked up to so that the user won't accidentally touch a selector while this whole animation is going on. Could someone help me with this as well?