Time for action – adding birds

In this game, the hunter will hunt birds, so let's create a bird object by performing the following steps:

  1. Open Xcode and create a new subgroup in the Resources group, next to the Hunter and the Backgrounds groups. Call this new group Birds.
  2. Open the Chapter_04/Assets/Birds folder and drag all images into the new Birds group in Xcode. Make sure that copy option is checked.
  3. Create a new Objective-C class in the GameObjects group. Name this class Bird and make it a subclass of CCSprite.
  4. Open the Bird.h file and replace its contents with the following code:
    #import "CCSprite.h" typedef enum BirdType { BirdTypeBig, BirdTypeMedium, BirdTypeSmall } BirdType; @interface Bird : CCSprite @property (nonatomic, assign) BirdType ...

Get Learning iPhone Game Development with Cocos2D 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.