我尝试在我的 GameLayer 中使用一些功能。第一个 - 来自另一个类,第二个 - 来自 GameLayer 类,但 CCSequence 像 CCSpawn 一样运行,而不是序列。另外,它们都在 GameLayer 中完美运行。
在游戏层中
[self runAction:[CCSequence actions:
[CCCallFuncN actionWithTarget:self.rolypoly selector:@selector(jumpToDeath:)],
[CCCallFuncND actionWithTarget:self selector:@selector(goToGameOverLayer:tagName:)data:(int)TagGameOverLose],
nil]];
在rolypoly类
-(void)jumpToDeath:(id)sender
{
[self.sprite stopAllActions];
id actionSpaw = [CCSpawn actions:
[CCMoveTo actionWithDuration:0.5f position:ccp(self.sprite.position.x, self.sprite.position.y+self.sprite.contentSize.height)],
[CCBlink actionWithDuration:1.0f blinks:4],
nil];
[self.sprite runAction:[CCSequence actions:
[CCCallFuncND actionWithTarget:self selector:@selector(setJumpingToDeath:withValue:)data:(void*)1],
actionSpaw,
[CCHide action],
[CCCallFunc actionWithTarget:self selector:@selector(moveSpriteDeath)],
nil]];
}