Cocos2d iphone C多组图像的动画化
有人能根据真/假条件帮助制作两组图像的动画吗?我收到错误消息,使用CCAnimation时无法静态分配接口类型。这是我的密码:Cocos2d iphone C多组图像的动画化,cocos2d-iphone,Cocos2d Iphone,有人能根据真/假条件帮助制作两组图像的动画吗?我收到错误消息,使用CCAnimation时无法静态分配接口类型。这是我的密码: //---frameSetOne for (int i=1; i<=4; i++) { [framesOne addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"bird%d.png",i]]]; }
//---frameSetOne
for (int i=1; i<=4; i++) {
[framesOne addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"bird%d.png",i]]];
}
//---frameSetTwo
for (int i=5; i<=8; i++) {
[framesTwo addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"bird%d.png",i]]];
}
if ( Answer == 1 ) {
CCAnimation _flyAnimation = [CCAnimation animationWithSpriteFrames:framesOne delay:0.07f];
}
else
{
CCAnimation _flyAnimation = [CCAnimation animationWithSpriteFrames:framesTwo delay:0.07f];
}
是否有人可以帮助纠正此问题,或建议使用true或false条件为多组帧/图像设置动画的不同方法
谢谢你的进步 试试看:
CCAnimation* _flyAnimation = [CCAnimation animationWithSpriteFrames:framesOne delay:0.07f];
调用类方法animationWithPriteFrames:method返回一个cAnimation*,而不是cAnimation。错误发生在哪一行?