Introtoduction to cocos2d

8,453 views

Published on

-cocos2d is one of the most popular open source projects for the iphone
- over 100 games shipped, with a number of them in the top 10

- This introductory course will get you up to speed on:
*basic architecture of the engine
*using Sprites and their more efficient counterpart, AtlasSprites
*user interaction (dealing with touch and multitouch events)
*particle system
*screen transitions
*actions

Published in: Technology, Travel
1 Comment
4 Likes
Statistics
Notes
  • http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/

    ===> tutorial on android
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
8,453
On SlideShare
0
From Embeds
0
Number of Embeds
60
Actions
Shares
0
Downloads
234
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Introtoduction to cocos2d

  1. 1. Introduction to 2d Game Programming Using cocos2d Serban Porumbescu Thursday, October 1, 2009
  2. 2. www.hiddenelephant.com Thursday, October 1, 2009
  3. 3. Overview • Why cocos2d? • Beginner Hurdles • cocos2d Basics • cocos2d Specifics • Samples and Tests • Resources Thursday, October 1, 2009
  4. 4. Why cocos2d? • Well over 200 games shipped • Great licensing • Lots of features • Extremely active community • What’s your business? Thursday, October 1, 2009
  5. 5. Beginner Hurdles Thursday, October 1, 2009
  6. 6. Beginner Hurdles • Objective-C and Memory • Setting Up a cocos2d Project • Running Samples and Tests • Understanding Tests Thursday, October 1, 2009
  7. 7. Learn Objective-C Read: “Learning Objective-C: A Primer” Thursday, October 1, 2009
  8. 8. Learn Memory Management Read: “Memory Management Programming Guide for Cocoa” Thursday, October 1, 2009
  9. 9. cocos2d Project Setup • Super easy ... now • sudo ./install_template.sh Thursday, October 1, 2009
  10. 10. Thursday, October 1, 2009
  11. 11. Thursday, October 1, 2009
  12. 12. Thursday, October 1, 2009
  13. 13. Running Samples & Tests • Wonderful source of examples that people seem to overlook • Once noticed, folks have issues running Thursday, October 1, 2009
  14. 14. Thursday, October 1, 2009
  15. 15. Running Samples & Tests • Where are they and how do we run? Thursday, October 1, 2009
  16. 16. Thursday, October 1, 2009
  17. 17. Thursday, October 1, 2009
  18. 18. Running Samples & Tests • Make sure to set both the “Active Target” and the “Active Executable” Thursday, October 1, 2009
  19. 19. Thursday, October 1, 2009
  20. 20. Thursday, October 1, 2009
  21. 21. Tests • Not games • Meant to exercise some specific functionality • Useful for figuring stuff out Thursday, October 1, 2009
  22. 22. Tests • Structured very similarly • Some base test class • Instantiate new test by advancing through NSStrings using NSClassFromString Thursday, October 1, 2009
  23. 23. Tests • Let’s look at AtlasSpriteTest and EaseActionsTest Thursday, October 1, 2009
  24. 24. cocos2d Basics Thursday, October 1, 2009
  25. 25. cocos2d Basics • Game has Scenes • Each Scene has some number of Layers • Layers capture user interaction and contain sprites • Director manages the scenes Thursday, October 1, 2009
  26. 26. Scenes • Screens in your game • Can almost think of them as separate apps Thursday, October 1, 2009
  27. 27. Layers • Take up the entire screen • Setup to handle touch and accelerometer • Can contain other layers and sprites (and other stuff) Thursday, October 1, 2009
  28. 28. Sprites Thursday, October 1, 2009
  29. 29. Director • Manages moving between Scenes • Pausing and running Scenes • Sets up OpenGL ES • Layer asks Director to move on Thursday, October 1, 2009
  30. 30. Thursday, October 1, 2009
  31. 31. cocos2d Specifics Thursday, October 1, 2009
  32. 32. Thursday, October 1, 2009
  33. 33. Important Classes • CocosNode • Scene • Layer • Director • AtlasSprite • AtlasSpriteManager Thursday, October 1, 2009
  34. 34. CocosNode Thursday, October 1, 2009
  35. 35. CocosNode • Lots of properties • position, scale, camera, OpenGL z position, children • Most objects in cocos2d inherit from CocosNode Thursday, October 1, 2009
  36. 36. Scene Thursday, October 1, 2009
  37. 37. Layer Thursday, October 1, 2009
  38. 38. Director(s) Thursday, October 1, 2009
  39. 39. AtlasSprite Thursday, October 1, 2009
  40. 40. AtlasSpriteManager Thursday, October 1, 2009
  41. 41. Sprite vs. AtlasSprite Thursday, October 1, 2009
  42. 42. Sprites Thursday, October 1, 2009
  43. 43. AtlasSprite Thursday, October 1, 2009
  44. 44. Sprite vs. AtlasSprite • In general, don’t use Sprites • AtlasSprites way faster • It’s all about the OpenGL ES Thursday, October 1, 2009
  45. 45. Samples and Tests Thursday, October 1, 2009
  46. 46. Resources http://www.cocos2d-iphone.org/ Thursday, October 1, 2009
  47. 47. Resources Wiki: http://www.cocos2d-iphone.org/wiki/doku.php/ Thursday, October 1, 2009
  48. 48. Resources Forums: http://www.cocos2d-iphone.org/forum/ Thursday, October 1, 2009
  49. 49. iPhoneGameJam.com Thursday, October 1, 2009
  50. 50. Thanks! Thursday, October 1, 2009

×