我试图在cocos2d中制作游戏。我有这个版本之前,他们谴责ccspritesheet和所有这些事情。我试图让一艘船爆炸。它的一个ccsprite,我跑在此代码 - (ID)初始动画崩溃程序COCOS2D
CCSpriteSheet * sheet = [CCSpriteSheet spriteSheetWithFile:@"Explode.png"];
[self addChild:sheet];
NSMutableArray * explosionFrames = [NSMutableArray array];
int spriteWidth = 256;
for (int i = 0; i <= 6; i++) {
[explosionFrames addObject:[CCSprite spriteWithSpriteSheet:sheet rect:CGRectMake(i*spriteWidth, 0, spriteWidth, 100)]];
}
CCAnimation * animation = [CCAnimation animationWithName:@"explode" delay:0.1f frames:explosionFrames];
CCAnimate * explosion = [CCAnimate actionWithDuration:.5f animation:animation restoreOriginalFrame:NO];
[self runAction:explosion];
当我运行它只是崩溃的程序直接关闭控制台说
-[CCSprite rect]: unrecognized selector sent to instance 0x54484f0
。
我不知道发生了什么事。这是我第一次试图在科科斯进行动画制作,我可能是一个白痴。任何帮助都和你一样棒。谢谢!
我不能上传精灵表im使用,因为我是新的,它不会让我,这是有道理的。但它的一个1792×100的PNG
的门票线索列车为$ 10上车! – 2013-02-11 06:28:07