Cocos2D

3,120 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,120
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
67
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Cocos2D

  1. 1. Cocos2D for iPhone<br />How to create amazing games in 30 minutes or less<br />
  2. 2. Cocos2D<br />Game framework ported from Python<br />Source distributed<br />Thin OpenGL wrapper<br />Objective C (XCode)<br />iOS: iPhone/iPad/iPod Touch<br />Mac OS X<br />
  3. 3.
  4. 4.
  5. 5. Nodes and sprites<br />Node<br />parent<br />children<br />position<br />rotation<br />scale<br />Sprite : Node<br />image<br />
  6. 6.
  7. 7. Action<br />Move<br />Scale<br />Rotate<br />Sequence<br />Repeat<br />CallFunc<br />MoveBy 10 pixels / 5 sec <br />[node runAction:action]<br />
  8. 8.
  9. 9. You are sky ASS<br />
  10. 10. Background<br />GameScene<br />addChild: sky<br />addChild: grass<br />addChild: ground<br />
  11. 11. Player plane<br />GameScene<br />addChild: PlayerPlane<br />addChild: plane sprite<br />- angle<br /><ul><li> velocity (constant )</li></li></ul><li>Player plane – simple fly<br />PlayerPlane fly<br />PlayerPlane node  MoveBy action<br />setPosition – process edges<br />
  12. 12. Player plane – vibrato effect<br />PlayerPlane sprite  MoveBy action<br />Sequence: Up 1, down 2, up 1<br />
  13. 13. Buttons<br />GameScene<br />ControlLayer Node<br />Button Node (with callback function)<br />Sprite<br />
  14. 14. Buttons – fly up/down actions<br />PlayerPlanegoUp<br />Angle + 5<br />Rotate sprite<br />Recalc movement<br />
  15. 15. Enemy plane<br />Same as PlayerPlane<br />Fly with +5 angle<br />
  16. 16. Bullets<br />PlayerPlane fire<br />Create Bullet node<br />Put to the GameScene<br />Set direction and [Bullet shoot]<br />
  17. 17. Bullets - shoot<br />Bullet node  MoveBy action<br />setPosition<br />check if hit enemy plane<br />
  18. 18. Bullets – BOOM!<br />EnemyPlane crash<br />Remove plane sprite<br />Show explosion sprite<br />Restart the game<br />
  19. 19.
  20. 20. PROFIT!!!<br />
  21. 21.
  22. 22. Cocos2D Features<br />
  23. 23. Box2D/Chipmunk integration<br />
  24. 24. Font rendering<br />
  25. 25. Touch handling<br />
  26. 26. Particles engine<br />
  27. 27. Free and open source<br />
  28. 28. Community<br />
  29. 29. Summary<br />
  30. 30. Contacts<br />StanislavKrasnoyarov<br />contact@polarowl.com<br />skr@land.ru<br />

×