如何使用cocos2d schedule的参数:function

时间:2013-09-26 10:35:11

标签: ios cocos2d-iphone selector

如何使用计划功能的参数

 [self schedule:@selector(cloudMovement:cloud1) interval:1/30];

-(void)cloudMovement:(CCSprite*)cloud
{
CGSize size = [[CCDirector sharedDirector] winSize];

  if (cloud.position.x == size.width )
  {
    [cloud setPosition:ccp(0,size.height-100)];
    [cloud runAction:[CCMoveTo actionWithDuration:20 position:ccp(size.width,size.height-100)]];
  }
}

0 个答案:

没有答案