I created a new project with cocos2d, and then create a layer and a sprite.
I am trying to apply an animation to my sprite, and I found some samples about that. But I don’t understand the difference between CCAnimation and CCAnimate, so I haven’t applied any animation for my sprite yet.
What is the difference between these two and what is the real meaning of them? How to use them?
Can any one explain me about that? Please help me.
Here is code from “Working with Sprites, and Sprite batch nodes” in cocos2d-iphone Programming Guide:
As you can see, you need to use both
CCAnimateandCCAnimationto run a CCSpriteFrame-based animation on the sprite. Per description ofCCAnimation:Generally speaking,
CCAnimationis a wrapper of frame container.CCAnimateis the action that the sprite need to do – in fact it is a subclass ofCCAction, which represents an action that a sprite can “run”, such as moving, jumping, rotating, etc. You can use its other subclasses to do some kinds of animation on your sprite without creating the frames yourself. Have a try with something likeCCFadeIn,CCRotateBy, etc.