Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.87 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Cocos2d scheduling selector in child node
  2. ParallaxMultipleBackgrounds *background = [self getChildByTag:GameSceneBackgroundBase];
  3. //I TRIED THIS:
  4. [background schedule:@selector(([background changeSpeedFactorBy:3])) interval:1];
  5. //AND
  6. [background schedule:@selector(changeSpeedFactorBy:3)];
  7. //AND
  8. [[background schedule:@selector(changeSpeedFactorBy:3) interval:1] ];
  9. //BUT..
  10.        
  11. ParallaxMultipleBackgrounds *background = [self getChildByTag:GameSceneBackgroundBase];
  12. background.modifier = 3;
  13. [background schedule:@selector(changeSpeedFactorBy:) interval:1];
  14.        
  15. CCCallFuncND *call = [CCCallFuncND actionWithTarget:background selector:@selector(changeSpeedFactorBy:) data:amont];
  16.  
  17. CCDelay *delay = [CCDelay actionWithDuration:1];
  18.  
  19. CCSequence *seq = [CCSequence actions:call,delay,nil];
  20.  
  21. CCRepeatForever *repeat = [CCRepeatForever actionWithAction:seq];
  22. [background runAction:repeat];