【幻灯片分享】在iOS平台上灵活使用Cocos2D | iOS独立开发者 秦春林 | iOS DevCamp

游戏引擎移植者现身讲解:《在iOS平台上用Cocos2D做开发》 | iOS独立开发者 秦春林 | iOS DevCamp

议题简介:Cocos2d是iOS平台上著名的游戏引擎,它开源,结构简单清晰,功能强大,是个人或者中小型团队开发的首选方案。本议题将以引擎移植者的身份清晰的讲解Cocos2D的结构,除此之外,还会分享App开发中的实际问题,例如灵活使用层,管理好触摸,整合使用Box2d物理引擎,Cocos2D与UIKit的整合等等开发中遇到的常见问题。

讲师简介:秦春林:独立开发者,曾就职于K2,金和,从事企业方面的开发,之后加入北京友录,OpenXLive从事Windows phone产品开发。2011年参与Cocos2d-x到Windows phone平台的移植,贡献了大部分核心功能,对Coco2D游戏引擎有深刻的了解,现从事iOS开发。热爱开源,喜欢交流。


推荐指数:4星

推荐理由:系统、清晰、生动,从入门到进阶。很翔实的幻灯片材料,很给力的讲解,配合现场演示,对于应用开发者很有用。

不足之处:对游戏开发比较精通的不要期待很高。

现场评分:3.8

【幻灯片分享】在iOS平台上灵活使用Cocos2D | iOS独立开发者 秦春林 | iOS DevCamp_第1张图片

【讲师现场靓照】

【幻灯片分享】在iOS平台上灵活使用Cocos2D | iOS独立开发者 秦春林 | iOS DevCamp_第2张图片


【幻灯片在线观看】*:

在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林 from Shining @DevCamp

备注:* 因为炫姐姐对SlideShare这一平台的偏爱,尽管需要使点小技巧才能上传分享,但是炫姐姐还是坚持选择了这一功能强大却简洁好用的平台。一来对国外这些开发出优秀的工具和平台、造福于互联网和人类的团队表示致敬,二来则是对国内对于这些优秀的工具和平台的限制表示一下立场。读者如果不能正常浏览,那么需要像炫姐姐一样用点小技巧。而对于那些还是不知道炫姐姐在说什么的小白读者,可以移步到这里查询原因。


【幻灯片下载页面】:iOS DevCamp幻灯片分享:在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林      -来自CSDN下载频道(不需要积分,自由下载)


【幻灯片内容刚要】:

1. iOS DevCamp Produced by CSDN
2. 怎样灵活使用Cocos2D 秦春林
3. Don’t reinvent the wheel
4. “In the summer of 2008, several "pythoneros" went to a camp program called PyCamp: Python outdoors. This camp held in Cordoba, in the town of Los Cocos. We were about 50 people. It covered different topics, one of which was seeking way of not having to "reinvent the wheel" in each jurisdiction Pyweek. In this way a group of friends and I decided to put together a framework to make games. We call cocos2d, since the framework is designed to make 2D games, and the word "coconut" emulates the place where the camp took place.” Ricardo Quesada
5. 4,000+ games
6. It is free! Without having to learn OpenGL ES to get started Active community & tests Lots of tools It is Simple Why Cocos2d?
7. How simple?
8. sprite: player Action: CCMoveTo layer: GameLayer scene: GameScene UIView:EAGLView
9. Game has Scenes Each Scene has some number of Layers Layers capture user interaction and contain sprites Director manages the scenes Cocos2d Basics
10. Anything thats gets drawn or contains things that get drawn is a CCNode
11. CCLayer CCMenu CCMenuItemLabel CCMenuItem CCMenuItemSprite CCMenuItemToggle CCParticleSystem CCNode CCScene CCTransitionScene CCSprite CCLabelTTF CCLabelBMFont CCSpriteBatchNode CCTMXLayer
12. Just like UIView
13. They can contain other CCNode nodes (addChild, getChildByTag, removeChild, etc) They can schedule periodic callback (schedule, unschedule, etc) They can execute actions (runAction, stopAction, etc) main features
14. Features of CCNode: - position - scale (x, y) - rotation (in degrees, clockwise) - CCCamera (an interface to gluLookAt ) - CCGridBase (to do mesh transformations) - anchor point - size - visible - z-order - openGL z position
15. - (CGAffineTransform)nodeToParentTransform; - (CGAffineTransform)parentToNodeTransform; - (CGAffineTransform)nodeToWorldTransform; - (CGAffineTransform)worldToNodeTransform; - (CGPoint)convertToNodeSpace:(CGPoint)worldPoint; - (CGPoint)convertToWorldSpace:(CGPoint)nodePoint; - (CGPoint)convertTouchToNodeSpace:(UITouch *)touch; transformation
16. CCLayer GamePlay CCScene CCLayer GamePlayScene Background
17. CCLayer is a subclass of CCNode that implements: - UIAccelerometerDelegate - CCStandardTouchDelegate - CCTargetedTouchDelegate
19. (NSSet*)touches NO targetedHandlersCount>o standardHandlersCount>o YES foreach...in touches YES foreach...in mutablesTouches foreach...in handlers ccTouchesBegan/Move/ End NO ccTouchBegan YES ccTouchMove/End NO End swallowsTouches NO YES remove from mutableTouches
21. You must register as a targeted touch delegate ccTouchBegan be invoked separately for each of the available touches The ccTouchBegan method return YES to indicate a touch you care about The swallowsTouches property return YES to indicate only this layer handle the touch Targeted Touch Delegate
22. A sample: How dose CCMenu work?
24. Which item is clicked?
26. Priority = 2 GameLayer Priority = 1 Priority = 0 Which Layer handle touch events?=
27. Return YES to claim the touch. -(BOOL)ccTouchBegan ! //* priority used by the menu for the event handler ! kCCMenuHandlerPriority = -128,
29. CCSprite is a 2d image
36. How does CCAction work?
39. Simple,but powerful
42. Box2D is C++ 2D rigid physics simulation engine with continuous collision detection All you files thats touch C++ or include it must be Objective- C++(.mm) Tuned for 1 meter sized objects Box2D v2.2.0 User Manual COCOS2D+BOX2D
43. A game in 6 steps
44. setp 1
45. what have the template done for us? initPhysics createMenu draw addNewSpriteAtPosition update ccTouchesEnded
47. Create the dynamic blocks setp 2
50. Touch events setp 3
52. Penguin animation setp 4
54. Fun with Particle Systems setp 5
55. music & effect [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"Penguino.mp3"]; [[SimpleAudioEngine sharedEngine] playEffect:@"PenguinSqueak3.mp3"]; setp 6
56. Labels and Fonts Particle system Tiled maps Draw & update Effects & Grid & Camera Transitions DrawingPrimitives RenderTexture Shader (2.0) ...... more features
58. THANK YOU [email protected] weibo.com/hielvis Now, how about this game?

你可能感兴趣的:(ios,windows,UIView,features,平台,phone,transformation)