Skip to content

Instantly share code, notes, and snippets.

@zorn
Created March 23, 2011 16:42
Show Gist options
  • Save zorn/883435 to your computer and use it in GitHub Desktop.
Save zorn/883435 to your computer and use it in GitHub Desktop.
#define CCCA(x) [[x copy] autorelease]
...
-(void) onEnter
{
[super onEnter];
CGSize s = [[CCDirector sharedDirector] winSize];
id move = [CCMoveBy actionWithDuration:3 position:ccp(s.width-130,0)];
id move_back = [move reverse];
id move_ease_in = [CCEaseIn actionWithAction:[[move copy] autorelease] rate:3.0f];
id move_ease_in_back = [move_ease_in reverse];
id move_ease_out = [CCEaseOut actionWithAction:[[move copy] autorelease] rate:3.0f];
id move_ease_out_back = [move_ease_out reverse];
id delay = [CCDelayTime actionWithDuration:0.25f];
id seq1 = [CCSequence actions: move, delay, move_back, CCCA(delay), nil];
id seq2 = [CCSequence actions: move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), nil];
id seq3 = [CCSequence actions: move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), nil];
CCAction *a2 = [grossini runAction: [CCRepeatForever actionWithAction:seq1]];
[a2 setTag:1];
CCAction *a1 =[tamara runAction: [CCRepeatForever actionWithAction:seq2]];
[a1 setTag:1];
CCAction *a = [kathia runAction: [CCRepeatForever actionWithAction:seq3]];
[a setTag:1];
[self schedule:@selector(testStopAction:) interval:6.25f];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment