如何在cocos2d中使用动画

时间:2014-10-23 19:48:11

标签: cocos2d-iphone spritebuilder

我是新手,我正在使用SpriteBuilder和cocos2D(最新版本)进行游戏,但我无法让动画工作。

我有这段代码:

id scaleHorDown = [CCScaleTo actionWithDuration:duration 5/30.f scaleX:0.75f scaleY:1.0f];

id scaleHorBouncing = [CCEaseBounceIn actionWithAction:scaleHorDown];
id scaleVerDown = [CCScaleTo actionWithDuration:duration 5/30.f scaleX:1.0f scaleY:0.65f];
id scaleVerBouncing = [CCEaseBounceInOut actionWithAction:scaleVerDown];

id shrink = [CCSequence actions:scaleHorBouncing,scaleVerBouncing, nil];

id swell = [CCScaleTo actionWithDuration: duration * 15/30.f scale:1.10f];
id swellEase = [CCEaseElasticOut actionWithAction:swell];

id resetScale = [CCScaleTo actionWithDuration:duration * 5/30.f scale:1.0f];
id resetScaleBouncing = [CCEaseInOut actionWithAction:resetScale];

id buttonAction = [CCSequence actions: shrink, swellEase, resetScaleBouncing, nil];

[self runAction:buttonAction];

但它不承认大多数方法。我猜这是进口的一个问题,但我已经尝试了很多东西而且没有...

谢谢!

0 个答案:

没有答案