Creating custom CCActions for cocos2d

What is the best way to create custom actions in coco2d?

I would like to create a custom action that will create an animation of gambling squash on my game objects. Am I just subclassing the CCFiniteTimeAction class and overriding the update method?

Any examples or links would be appreciated.

Also, as part of my custom action, I would like to use the CCScale action. Is it possible?

+3
source share
2 answers

Yes, thatโ€™s almost all magic. An example can be found at http://getsetgames.com/2009/09/23/custom-cocos2d-action-for-animating-an-atlassprites-texturerect/

CCScale. , , .

+2

, CCSequence

- :

-(CCSequence)squash{
id action1=....//define action
id action2=...2nd action
...
return [CCSequence actions: action1, action2,..., nil];
}

[mySprite runAction:[self squash]];

( ( CCCallFunc)

- , , (.. java, iphone cocos2d)

- . , .

+2

All Articles