views:

421

answers:

2

hi all friends,

I am new to cocos2d animations and I want to learn it , as always I stops at the point of animation while making iPhone games in cocos2d.

Can any one suggest me the way to learn such animations, so that games animation creating will become easy to make.

Thanks.

+2  A: 

There are several cocos2d tutorials avaliable around the net. Also take a look at their docs. Another good resource can be github.com where you'll find at least couple of opensource games made in cocos2d

dusker
ok buddy thanks.
iPhone Fun
+3  A: 

Hi,

Seems like there are 2 ways to go - either your sprites are laid out in a regular fashion and so can be picked off the sprite sheet in a programmatic way, like this first example. The other way is to use a tool like Zwoptex to create the sprite sheet and a corresponding plist that tells Cocos2d where to find the images on the sheet, see second example.

Tutorial for getting sprites off a sheet, using a regular layout:

http://getsetgames.com/2010/04/18/how-to-animate-sprites-in-cocos2d/

The basics are:

  1. Get your images into one large image/texture
  2. Create a CCSpriteSheet using that texture
  3. Create a CCSprite using one of the images in your sprite sheet
  4. Create a CCAnimation and populate it with CCSpriteFrame's - each representing a frame in the animation
  5. Create a CCAnimate action to manage showing each frame and run it on sprite, voila.

The alternative is to use a tool like Zwoptex to configure your images on a sheet which will export the sprite sheet and a plist of details of the images on it.

The first third of this tutorial explains it:

http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone

Hope that helps, Chris

Chris Kimpton
Thanks buddy this is a nice one.
iPhone Fun