Your SlideShare is downloading. ×
0
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Iphone and Ipad development Game with Cocos2D

2,727

Published on

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,727
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
105
Comments
1
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1.  
  • 2.
    • Intro to IOS App Development
    • Intro Cocos2D
    • Let’s make a Cocos2D game
    • Conclusion
    • Resources
  • 3.
    • IOS 2D Gamming
  • 4. -120 million ios devices -250 apps sold every second -250000 total apps
    • Why IOS?
  • 5.
    • So, what do you need to get started
  • 6.
    • IOS Technology Stack
  • 7.
    • 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
  • 8.
    • Why Cocos2D?
    -Active community http://www.cocos2d-iphone.org/forum/
  • 9.
    • Why Cocos2D?
    -Wiki http://www.cocos2d-iphone.org/wiki/doku.php/
  • 10. -Features / Engine Model
  • 11. -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
  • 12. -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
  • 13. -Declarate Objects
  • 14. -Class Interfaces When you want to include header files in your source code, you typically use a  #import  directive
  • 15. -Call Methods
  • 16. -Methods declarate syntax
  • 17. -Class implementation
  • 18. -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
  • 19. -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; }
  • 20. Structure -Game has Scenes -Each Scene has some nuber of Layer -Layers capture user interaction and contain sprites -Director manages the scenes
  • 21. 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
  • 22. Director -Manages moving between Scenes -Pausing and running Scenes -Sets up OpenGL ES -Layer ask Director to move on
  • 23. Scenes Each Scene contains several full screen Layers Layers define appearance, behavior and user input Yaers contain Sprites wich are the game elements
  • 24. Layers -Take up the entire screen -Setup to handle touch and accelerometer -Can contain other layers and sprites
  • 25. Important Classes -CocosNode -Scene -Layer -Director -AtlasSprite -AtlasSPriteManager
  • 26. CocosNode -Lost of properties -Position, Scale, Camera, OpenGl z position, children -Most objects in cocos2d inherit form CocosNode
  • 27. Scene
  • 28. Layer
  • 29. Director
  • 30. AtlasSprite
  • 31. AtlasSpriteManager
  • 32. Sprite VS AtlasSprite -Sprite -AtlasSprite -In general, dont’t use Sprites -AtlasSPrites way faster -It’s all about the OpenGL ES
  • 33. -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
  • 34. -New project -Execute Xcode, and selected new project cocos aplication
  • 35. -Project structure -General
  • 36. -Project structure –AlphaGeeksAppDelegate.m
  • 37. -Project structure –HelloWordScene.h
  • 38. -Project structure –HelloWordScene.m
  • 39. -Adding Background
  • 40. -Adding Our Hero
  • 41. -Adding Bad Guys (Game Logic)
  • 42. -Killing Bad Guys (Adding UI)
  • 43. -Animating Out Hero
  • 44. -Animating Bad Guys Dying
  • 45. -Adding Body Count
  • 46. -Adding Sound & Music
  • 47. 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/

×