Iphone and Ipad development Game with Cocos2D
Upcoming SlideShare
Loading in...5

Iphone and Ipad development Game with Cocos2D






Total Views
Views on SlideShare
Embed Views



4 Embeds 105

http://www.creagamers.es 49
http://www.creagames.es 45
http://creagamers.es 8
http://localhost 3



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.


11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Iphone and Ipad development Game with Cocos2D Iphone and Ipad development Game with Cocos2D Presentation Transcript

      • Intro to IOS App Development
      • Intro Cocos2D
      • Let’s make a Cocos2D game
      • Conclusion
      • Resources
      • IOS 2D Gamming
    • -120 million ios devices -250 apps sold every second -250000 total apps
      • Why IOS?
      • So, what do you need to get started
      • IOS Technology Stack
      • Why Cocos2D?
      -iOS game development framework based on original cocos2d for python developed by Ricardo Quesada Based on OpenGL 1.1 -Open Source, latest version -Multiplatforms: iOS, uPhone, Win32. Coming soon: Bada, Android cocos2d-x, in C++, multiplatform cocos2d-android-1, in Java, for Android cocos2d-javascript, in Javascript, for Web cocos2d-iphone, in Python for iphone and ipad - It is easy to use, to create simple graphics applications
      • Why Cocos2D?
      -Active community http://www.cocos2d-iphone.org/forum/
      • Why Cocos2D?
      -Wiki http://www.cocos2d-iphone.org/wiki/doku.php/
    • -Features / Engine Model
    • -Quick intro to Objective-C Apple’s object oriented implementation of C Influenced by Smalltalk style messaging Originally built for NeXTSTEP Used for Mac OS X and IOS development Moderate
    • -Type files Header files. Header files contain class, type, function, and constant declarations. Source files. This is the typical extension used for source files and can contain both Objective-C and C code. Source files. A source file with this extension can contain C++ code in addition to Objective-C and C code. This extension should be used only if you actually refer to C++ classes or features from your Objective-C code. .h .m .mm When you want to include header files in your source code, you typically use a  #import  directive
    • -Declarate Objects
    • -Class Interfaces When you want to include header files in your source code, you typically use a  #import  directive
    • -Call Methods
    • -Methods declarate syntax
    • -Class implementation
    • -Example 1 - Class #import <Foundation/Foundation.h> class Hello { private: id greeting_text; // holds an NSString public: Hello() { greeting_text = @&quot;Hello, world!&quot;; } Hello(const char* initial_greeting_text) { greeting_text = [[NSString alloc] initWithUTF8String:initial_greeting_text]; } void say_hello() { printf(&quot;%sn&quot;, [greeting_text UTF8String]); } }; @interface Greeting : NSObject { @private Hello *hello; } - (id)init; - (void)dealloc; - (void)sayGreeting; - (void)sayGreeting:(Hello*)greeting; @end @implementation Greeting - (id)init { self = [super init]; if (self) { hello = new Hello(); } return self; } - (void)dealloc { delete hello; [super dealloc]; } - (void)sayGreeting { hello->say_hello(); } - (void)sayGreeting:(Hello*)greeting { greeting->say_hello(); } @end
    • -Example 1 - Main int main() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; Greeting *greeting = [[Greeting alloc] init]; [greeting sayGreeting]; // > Hello, world! Hello *hello = new Hello(&quot;Bonjour, monde!&quot;); [greeting sayGreeting:hello]; // > Bonjour, monde! delete hello; [greeting release]; [pool release]; return 0; }
    • Structure -Game has Scenes -Each Scene has some nuber of Layer -Layers capture user interaction and contain sprites -Director manages the scenes
    • Director & Scenes Game made up of «game screens» called Screnes Each Scene can be considered a separate app Director handles main windows and executes Scenes
    • Director -Manages moving between Scenes -Pausing and running Scenes -Sets up OpenGL ES -Layer ask Director to move on
    • Scenes Each Scene contains several full screen Layers Layers define appearance, behavior and user input Yaers contain Sprites wich are the game elements
    • Layers -Take up the entire screen -Setup to handle touch and accelerometer -Can contain other layers and sprites
    • Important Classes -CocosNode -Scene -Layer -Director -AtlasSprite -AtlasSPriteManager
    • CocosNode -Lost of properties -Position, Scale, Camera, OpenGl z position, children -Most objects in cocos2d inherit form CocosNode
    • Scene
    • Layer
    • Director
    • AtlasSprite
    • AtlasSpriteManager
    • Sprite VS AtlasSprite -Sprite -AtlasSprite -In general, dont’t use Sprites -AtlasSPrites way faster -It’s all about the OpenGL ES
    • -Setup project -New project -Project Structure -Adding Background -Adding Our Hero -Adding Bad Guys (Game Logic) -Killing Bad Guys (Adding UI) -Animating Out Hero -Animating Bad Guys Dying -Adding Body Count -Adding Sound & Music
    • -New project -Execute Xcode, and selected new project cocos aplication
    • -Project structure -General
    • -Project structure –AlphaGeeksAppDelegate.m
    • -Project structure –HelloWordScene.h
    • -Project structure –HelloWordScene.m
    • -Adding Background
    • -Adding Our Hero
    • -Adding Bad Guys (Game Logic)
    • -Killing Bad Guys (Adding UI)
    • -Animating Out Hero
    • -Animating Bad Guys Dying
    • -Adding Body Count
    • -Adding Sound & Music
    • http://developer.apple.com http://www.slideshare.net/360conferences/introtoduction-to-cocos2d?src=related_normal&rel=5237272 http://www.slideshare.net/Greenwell/iphone-and-ipad-game-development-with-cocos2d http://www.cocos2d-iphone.org/ http://cocos2d.org/