iOS Game Development
iOS Game Development
    with Cocos2d
http://www.eddie.com.tw
aquarianboy@ptt
eddie@digik.com.tw
aquarianboy@plurk
eddiekao@facebook
Pray for the victims of the Japan Earthquake.




http://www.itplanning.co.jp/
"It feels like we’re back in the dot
com era. Everyone wants an iPhone
application."
                     Siddhart Agarwal, CEO, Mobicule
Today, We’ll learn...
Today, We’ll learn...
1. setup the working environment
Today, We’ll learn...
1. setup the working environment
2. say hello to the world again.
Today, We’ll learn...
1. setup the working environment
2. say hello to the world again.
3. play with sprite.(not kind of drink!)
Today, We’ll learn...
1. setup the working environment
2. say hello to the world again.
3. play with sprite.(not kind of drink!)
4. menu and scene
Before We Start..
Do you really need an i-device
for developing iOS apps?
iPhone or iPad?
What’s Cocos2d?
Why Cocos2d?

- Open source!
- Language: Objective-C.
- Active community and forum
- Work on all Apple devices, including the mobile devices,
  desktop and laptop.
- Awesome features:
    Transitions
    Integrated Box2d and Chipmunk 2d physics engine.
    Particle system.
    Tile Map support.
    Touch/Accelerometer support.
    ...
MIT License
3.3.1?
Who uses Cocos2d?

More than 1500 AppStore games already use it,
      including many best seller games.

    http://www.cocos2d-iphone.org/games/
Something you should know...
Even Cocos2d for iPhone is a great and powerful game engine,
I don’t think you’re be able to create good apps without
learning any knowledge of Objective-C or Cocoa Framework.
Download & Install


https://github.com/cocos2d/cocos2d-iphone

1.   download the source code.
2.   unpack and enter that directory with terminal.
3.   ./install_template.sh -u, and...done!
4.   open your Xcode, you should see several cocos2d
     project templates.
Documents and References


1. official website & blog
2. sample code
3. community and forum
4. books
5. read the source, luke!
Say hello to the world!
Base SDK Missing Problem?
Game flow



                  new game



intro    menu                 Level 1    Level 2    Level 3   End

                  load game


                                        Game over

        options   Settings
Architecture

Director                                      Something you should know:

                                              1. One scene can contain several
                                      Scene   layer, and one layer can contain
                                              several sprites.

                                              2. Just like the layer in Adobe
                                              Photoshop, upper layer might
           Layer                              block the lower layer. And upper
                                              layer have higher z value, you
  Sprite   Sprite   Sprite                    can rearrange them by changing
                                              the z value.

                                              3. You can have more than one
                                              scene, but only one will be
                                              activated at a given time.
                     Layer
                                              4. There is only one
                                              director(singleton), and it
                                              takes care of going back and
                              Layer           forth between scenes.

                                              5. They all inherited from the
                                              same boss, the CCNode.
CCNode
Live demo!
Looking for
AS3/Ruby/Rails/iOS
     Developers
WorkingWithEddie@gmail.com
Thank You!
                       2011/3/16
             Kaos’ Digital Network, Ltd.
                 TEL +886-2-2682-4700
No.26, Ln. 248, Junying St., Shulin Dist., New Taipei
              City 238, Taiwan (R.O.C.)




      Welcome to visit http://digik.tw for more information!

iOS Game Development with Cocos2d