SlideShare a Scribd company logo
iOS gaming with cocos2dPrepared by Ngo Duc HiepCopyright 2011 PTT Solution ., JSC. All rights reserved.Hanoi, May 2011
iOS game enginescocos2dSparrowGalaxyoolong
iOS game enginesGame saladCoronaUnityiTorque
iOS game engineshttp://maniacdev.com/2011/01/open-source-and-commercial-ios-game-engine-listings-updated/http://maniacdev.com/2009/09/the-commercial-iphone-game-engine-comparison-3d-and-2d/
cocos2d gamesTap Pet Hotel: #1 FreeZombie Farm: #6 FreeTap Zoo: #2 FreeiStunt 2: #6 Free
cocos2d gamesZombieSmash: #1 PaidAir Penguin: #1 PaidTrainyard: #2 PaidFishing Frenzy: #7 Paid
cocos2d
App workflowSettingsLoadingHomeGame PlayLeaderboard
App workflowCCSceneCCDirector: run, push, pop replace scene[[CCDirectorsharedDirector] runWithScene:loading];
[[CCDirectorsharedDirector] replaceScene:home];
CCTransition: transition between scenesCCLayer
CCLayerHandle eventisTouchEnabled_
isAccelerometerEnabled_Game controllerMange game entities - CCNode
CCNodeRenderable itemCCLayer, CCScene are all nodesFeaturesContains another nodes
Schedule timer
Play actions
Position/rotation/scale/contentSizeCCSpriteSpritesTexture
CCNode: CoordinatecontentSize.widthcontentSize.height
CCNode: CoordinateanchorPointrotationposition
CCNode: Coordinate
CCNode: Transformation- (CGAffineTransform)nodeToParentTransform;- (CGAffineTransform)parentToNodeTransform;- (CGAffineTransform)nodeToWorldTransform;- (CGAffineTransform)worldToNodeTransform;- (CGPoint)convertToNodeSpace:(CGPoint)worldPoint;- (CGPoint)convertToWorldSpace:(CGPoint)nodePoint;
CCNode: ActionsModify node’s attributes by timeposition/rotation/scale/opacity/gridInterval actions and Instant actions
CCNode: ActionsCCMove_CCJump_CCBezier_CCScale_CCRotate_CCFade_
CCNode: ActionsTime alter actions:CCEase_
CCEaseExponential_
CCEaseSine_
CCEaseElastic_
CCEaseBounce_CCNode: Special actionsCCCallFuncCCCallBlockCCPropertyActionCCFollowCCSequenceCCSpawnCCRepeat
CCNode: 3D EffectsCCFlipX3D/CCFlipY3DCCWaves3DCCRipple3DCCSplitRows…
CCSprite: Animation
CCSprite: Animation
CCNode: Scheduler-(void) schedule: (SEL) s interval:(ccTime)seconds;-(void) unschedule: (SEL) s;-(void) pauseSchedulerAndActions;-(void) resumeSchedulerAndActions;
Touch DispathcherCCTouchDispathcher-(void) addStandardDelegate:(id) delegate priority:(int)priority;-(void) addTargetedDelegate:(id) delegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches;-(void) removeDelegate:(id) delegate;
Box2D
FeaturesRigid bodyFixture: rectangle, circle, poligonJointContact filterContact listenerSimulate	world->Step(dt);
cocos2d  Box2DBody, joint, fixture user datafor (b2Body* b = world->GetBodyList(); b; b = b->GetNext()){	if (b->GetUserData() != NULL) {CCSprite *actor = (CCSprite*)b->GetUserData();actor.position = CGPointMake( b->GetPosition().x , b->GetPosition().y);actor.rotation = -b->GetAngle() * 180 / M_PI;	} }
CarCocos2dccCarBodyccCarWheel1ccCarWhell2Box2Db2CarBody
b2CarWheel1
b2CarWhell2
b2CarJoint1
b2CarJoint2cocos2d+ext
CCNode+extTransform- (CGAffineTransform) nodeToNodeTransform:					(CCNode *) node;- (CGAffineTransform) nodeFromNodeTransform:					(CCNode *) node;
CCNode+extTransformCollision- (CGRect) rect;
- (BOOL) isCollideWithNode:(CCNode *) node;CCNode+extTransformCollisionContaining- (BOOL) containsPoint:(CGPoint) loc;
- (BOOL) containsTouch:(UITouch *) touch;CCSprite+ext- (CCAction *) animateFramesWithKey:(NSString *) key startIndex:(int) start endIndex:(int) end duration:(float) duration reverse:(BOOL) reverse forever:(BOOL) forever;
CCComponentIndependent, portableStates controlData drivenCallbacksPhysics supportComposition
CCComponentDataTexture fileTexture def fileComponent def fileStatesChilds
CCComponentStatesAnimate framesRotate ScaleFade
CCComponentLion_jump_1.pngLion_jump_2.pngLion_jump_4.pngLion_jump_3.png

More Related Content

KEY
Cocos2d実践編 1.0.0rc
DOCX
Est 8 2 nd
PPTX
Better performance through Superscalarity
TXT
Layer 2221 1 Subidazbuka
PPT
Hanoi php day 2008 - 02. phan thai trung - drupal
PPT
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
PPT
8 - Javascript unit testing framework
PPT
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascript
Cocos2d実践編 1.0.0rc
Est 8 2 nd
Better performance through Superscalarity
Layer 2221 1 Subidazbuka
Hanoi php day 2008 - 02. phan thai trung - drupal
05 - Phan Thai Trung - Tu dong dat hang tu he thong ban le lon nhat Trung Quoc
8 - Javascript unit testing framework
Hanoi php day 2008 - 03. dang minh tuan - html, css, javascript

Similar to iOS Gaming with Cocos2d (20)

PDF
Cocos2d 소개 - Korea Linux Forum 2014
PPTX
PDF
Cocos2d programming
PDF
cocos2d for i Phoneの紹介
PDF
Creating physics game in 1 hour
PPTX
Game development with Cocos2d
PDF
Cocos2d game programming 2
PPTX
Cocos2d for beginners
PPTX
Iphone game developement - In a game things always move
PDF
Basics cocos2d
PDF
Demo creating-physics-game.
PDF
Game development with Cocos2d-x Engine
KEY
cocos2d 事例編 HungryMasterの実装から
PDF
在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林
KEY
Cocos2dを使ったゲーム作成の事例
PDF
Introduction to Cocos2d
PDF
Introduction to-cocos2d
PDF
Dev Story of our first iOS game
PDF
Under Cocos 2 D Tree_mdevcon 2013
PDF
Under Cocos2D Tree @mdvecon 2013
Cocos2d 소개 - Korea Linux Forum 2014
Cocos2d programming
cocos2d for i Phoneの紹介
Creating physics game in 1 hour
Game development with Cocos2d
Cocos2d game programming 2
Cocos2d for beginners
Iphone game developement - In a game things always move
Basics cocos2d
Demo creating-physics-game.
Game development with Cocos2d-x Engine
cocos2d 事例編 HungryMasterの実装から
在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林
Cocos2dを使ったゲーム作成の事例
Introduction to Cocos2d
Introduction to-cocos2d
Dev Story of our first iOS game
Under Cocos 2 D Tree_mdevcon 2013
Under Cocos2D Tree @mdvecon 2013
Ad

More from Nguyen Duc Phu (13)

PPT
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
PPT
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
PPT
13 social network game
PPTX
12 trung-oss-magento-overview
PPT
11 building joomla! extensions with flex integration
PDF
10 su dung drupal xay dung mang xa hoi
PPT
09 html5 css3-the_future_of_web_technology
PPT
07 build your-own_php_extension
PDF
04 web optimization
PDF
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
PDF
01 zingme practice for building scalable website with php
PPT
14 how startups can benefit from launch community
PPT
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...
Hanoi php day 2008 - 05. nguyen hai nhat huy - building-restful-web-service-w...
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
13 social network game
12 trung-oss-magento-overview
11 building joomla! extensions with flex integration
10 su dung drupal xay dung mang xa hoi
09 html5 css3-the_future_of_web_technology
07 build your-own_php_extension
04 web optimization
02 vng thanhnt-speedup_ntvv2_by_ph_pextmodule_
01 zingme practice for building scalable website with php
14 how startups can benefit from launch community
Hanoi PHP Day 2008 - 04 - Nguyen Duc Phu - Search Engine: New Collection S...
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

iOS Gaming with Cocos2d