Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. CCLayer *foreground = [CCLayer node];
  2. CCSprite* background = [CCSprite spriteWithFile:@"background.png" ];
  3. background.position = ccp( 150, -120 );
  4.  
  5. seeker1 = [CCSprite spriteWithFile: @"wave.png"];
  6. seeker1.position = ccp( 180, 420 );
  7. [seeker1 addChild:background z:-1];
  8.  
  9. [foreground addChild:seeker1];
  10.  
  11. [self addChild:foreground z:1];
  12.  
  13.  
  14. id waves = [CCWaves actionWithWaves:5 amplitude:15 horizontal:YES vertical:YES grid:ccg(15,10) duration:5];
  15. id a1 = [CCMoveBy actionWithDuration:3 position:ccp(0,-200)];
  16.  
  17. id action2 =
  18. [CCSequence actions: [[a1 copy] autorelease], [a1 reverse], nil];
  19.  
  20. id action = [CCSpawn actions:
  21. action2,
  22. waves,
  23. nil];
  24. [seeker1 runAction:action];
  25.  
  26. [foreground addChild:background z:-1];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement