SlideShare a Scribd company logo
1 of 37
Download to read offline
Farmery development using
cocos2d-x
Vu Ngoc Kien - Game Studio North / VNG
Farmery Game
Farmery Game
 Over 1M downloads on Google Play
 Top 10 frees on Apple Store
 Run well on low specs as Galaxy Y phone
 Coming soon on WP
Cocos2d-x -
Cross platform game engine
 2D Cross-Platform engine game
 Open source
 High performance
 Using cocos2d-ios documents as APIs are
similar
 Many support tools
Advantages
 Not easy
 Many choices: C++, Lua, Java Script
 Use C++ language
 Require understandings of different
platforms setup
Approach Cocos2d-x
1. Animation in Farmery game
2. Multiscreen in Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
 Over 125 animations in game
 Optimize to save memory
1. Animation in Farmery
Frame-By-Frame Animation
64 pictures, 2MB
Tween Animation
5 pictures, 240 KB
Make Animations using Dragon Bone
http://dragonbones.github.io
Artists produce objects parts
Assemble animations on Flash
Extract animation file using
Dragon Bone
Result
 Using flash in animation
 Import PSD Layer
 Support pictures skewing
Advantages
1. Animation in Farmery game
2. Multi screen in Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
2. Multi screen in Cocos2d-x
480 x 320
2048 x 1536
1136 x 640
1080 x 1920
 DesignResolutionSize: standard screen size
 CCEGLView::sharedOpenGLView()->setDesignResolutionSize
(width, height, policy)
 Policy:
• Exact fit
• Show all
• No border
• Fixed Height
• Fixed Width
Multiscreen in cocos2d-x
Picture looks stretched
Exact fit
2 black edges on the screen
Show all
No border
 contentScaleFactor = RH/DH, resource for screen suitably
 contentScaleFactor = (RH/DH)/ (MIN(fScaleX, fScaleY) /
MAX(fScaleX, fScaleY)).
fScaleX = FW/ DW; float fScaleY = FH/DH.
contentScaleFactor
Farmery displays well on different
screen sizes
1. Animation in Farmery game
2. Multiscreen by Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
Require Cygwin, NDK
Setup NDK path
Can’t debug native
Build cocos2d-x on Android by Cygwin on
Windows
Build cocos2d-x on Android by eclipse
 Not require Cygwin
 Can debug native
 Undefined Cygwin
(properties -> C/C++ Build -> Environment)
Edit Project Properties
 Use Android GCC tool chain
(properties -> C/C++ Build -> Tool Chain Editor)
Edit Project Properties
• Setting build command: ndk-build NDK_DEBUG=1 –j8
(properties -> C/C++ Build -> Builder Setting)
Edit Project Properties
Link Classes folder
(properties -> C/C++ General -> Paths and
Symbols -> Source Location)
Edit Project Properties
 Add module path
$(call import-add-path,(LOCAL_PATH)/../../../../../)
$(call import-add-
path,(LOCAL_PATH)/../../../../../cocos2dx/platform/third_party/
android/prebuilt)
$(call import-module,cocos2dx)
Edit file Android.mk
Crash will show on LogCat
Use Breakpoint to debug
1. Make Animation with Flash and Dragon Bone
2. Multiscreen by Cocos2d-x
3. Debug cocos2d-x on Android by Eclipse
Develop Farmery by Cocos2d-x
Farmery development using cocos2d-x
Vu Ngoc Kien
KienVN@vng.com.vn
(Game Studio North /VNG)

More Related Content

What's hot

Game development via_sprite_kit
Game development via_sprite_kitGame development via_sprite_kit
Game development via_sprite_kitBuşra Deniz, CSM
 
iOS Game Development: When Cocoa Met Cocos...
iOS Game Development: When Cocoa Met Cocos...iOS Game Development: When Cocoa Met Cocos...
iOS Game Development: When Cocoa Met Cocos...Joseph Ku
 
Operation P.E.A.C.E. 2.0 - Game Development
Operation P.E.A.C.E. 2.0 - Game DevelopmentOperation P.E.A.C.E. 2.0 - Game Development
Operation P.E.A.C.E. 2.0 - Game DevelopmentMEGA Generation
 
Mobile Game Development in Unity
Mobile Game Development in UnityMobile Game Development in Unity
Mobile Game Development in UnityHakan Saglam
 
What Is A Game Engine
What Is A Game EngineWhat Is A Game Engine
What Is A Game EngineSeth Sivak
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game EngineDiksha Bhargava
 

What's hot (8)

Game development via_sprite_kit
Game development via_sprite_kitGame development via_sprite_kit
Game development via_sprite_kit
 
iOS Game Development: When Cocoa Met Cocos...
iOS Game Development: When Cocoa Met Cocos...iOS Game Development: When Cocoa Met Cocos...
iOS Game Development: When Cocoa Met Cocos...
 
Cocos2D
Cocos2DCocos2D
Cocos2D
 
Operation P.E.A.C.E. 2.0 - Game Development
Operation P.E.A.C.E. 2.0 - Game DevelopmentOperation P.E.A.C.E. 2.0 - Game Development
Operation P.E.A.C.E. 2.0 - Game Development
 
Unity - Game Engine
Unity - Game EngineUnity - Game Engine
Unity - Game Engine
 
Mobile Game Development in Unity
Mobile Game Development in UnityMobile Game Development in Unity
Mobile Game Development in Unity
 
What Is A Game Engine
What Is A Game EngineWhat Is A Game Engine
What Is A Game Engine
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
 

Similar to OGDC 2014: Program farmery by cocos2dx

Build a Game in 60 minutes
Build a Game in 60 minutesBuild a Game in 60 minutes
Build a Game in 60 minutesTroy Miles
 
Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8Troy Miles
 
06 html5 and cocos2d-x
06   html5 and cocos2d-x06   html5 and cocos2d-x
06 html5 and cocos2d-x乐费 胡
 
Farm Moles Android Game
Farm Moles Android GameFarm Moles Android Game
Farm Moles Android GameFarouq Mousa
 
Processing for Android: Getting Started
Processing for Android: Getting StartedProcessing for Android: Getting Started
Processing for Android: Getting StartedPETER KIRN
 
Targeting Android with Qt
Targeting Android with QtTargeting Android with Qt
Targeting Android with QtEspen Riskedal
 
Cross Game Dev with Corona
Cross Game Dev with CoronaCross Game Dev with Corona
Cross Game Dev with CoronaShawn Grimes
 
Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...DevGAMM Conference
 
Game development with_lib_gdx
Game development with_lib_gdxGame development with_lib_gdx
Game development with_lib_gdxGabriel Grill
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2dVinsol
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyonotolab
 
Develop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosDevelop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosLuke Stapley
 
Cocos2d for i phone(second) copy
Cocos2d for i phone(second)   copyCocos2d for i phone(second)   copy
Cocos2d for i phone(second) copyArafat X
 
Android game engine
Android game engineAndroid game engine
Android game engineJulian Chu
 

Similar to OGDC 2014: Program farmery by cocos2dx (20)

Build a Game in 60 minutes
Build a Game in 60 minutesBuild a Game in 60 minutes
Build a Game in 60 minutes
 
Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8
 
06 html5 and cocos2d-x
06   html5 and cocos2d-x06   html5 and cocos2d-x
06 html5 and cocos2d-x
 
Farm Moles Android Game
Farm Moles Android GameFarm Moles Android Game
Farm Moles Android Game
 
Processing for Android: Getting Started
Processing for Android: Getting StartedProcessing for Android: Getting Started
Processing for Android: Getting Started
 
Targeting Android with Qt
Targeting Android with QtTargeting Android with Qt
Targeting Android with Qt
 
Cocos2d game programming 2
Cocos2d game programming 2Cocos2d game programming 2
Cocos2d game programming 2
 
Cross Game Dev with Corona
Cross Game Dev with CoronaCross Game Dev with Corona
Cross Game Dev with Corona
 
Cocos2d for beginners
Cocos2d for beginnersCocos2d for beginners
Cocos2d for beginners
 
For cocos2d jpn devcon
For cocos2d jpn devconFor cocos2d jpn devcon
For cocos2d jpn devcon
 
Indie Game Development
Indie Game DevelopmentIndie Game Development
Indie Game Development
 
Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...Spooky House Studios: Game development for smartwatches. Challenges and solut...
Spooky House Studios: Game development for smartwatches. Challenges and solut...
 
Game development with_lib_gdx
Game development with_lib_gdxGame development with_lib_gdx
Game development with_lib_gdx
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
 
Cocos2d programming
Cocos2d programmingCocos2d programming
Cocos2d programming
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
ngGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and TokyongGoBuilder and collaborative development between San Francisco and Tokyo
ngGoBuilder and collaborative development between San Francisco and Tokyo
 
Develop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosDevelop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By Cocos
 
Cocos2d for i phone(second) copy
Cocos2d for i phone(second)   copyCocos2d for i phone(second)   copy
Cocos2d for i phone(second) copy
 
Android game engine
Android game engineAndroid game engine
Android game engine
 

More from GameLandVN

Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian women
Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian womenMobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian women
Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian womenGameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...GameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in India
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in IndiaMobile Game Asia 2015 Ho Chi Minh City: Mobile game market in India
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in IndiaGameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...GameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...GameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...GameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video ads
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video adsMobile Game Asia 2015 Ho Chi Minh City: Rewarded video ads
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video adsGameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in VietnamMobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in VietnamGameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetization
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetizationMobile Game Asia 2015 Ho Chi Minh City: Predictive monetization
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetizationGameLandVN
 
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creation
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creationMobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creation
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creationGameLandVN
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureCloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureGameLandVN
 
Windows app & Microsoft's support
Windows app & Microsoft's supportWindows app & Microsoft's support
Windows app & Microsoft's supportGameLandVN
 
Kinh nghiệm phát triển Captain Strike
Kinh nghiệm phát triển Captain StrikeKinh nghiệm phát triển Captain Strike
Kinh nghiệm phát triển Captain StrikeGameLandVN
 
Microsoft BizSpark
Microsoft BizSparkMicrosoft BizSpark
Microsoft BizSparkGameLandVN
 
Microsoft Azure Introduction
Microsoft Azure IntroductionMicrosoft Azure Introduction
Microsoft Azure IntroductionGameLandVN
 
OGDC 2014: Animation workflow with Spine in Tiny Busters
OGDC 2014: Animation workflow with Spine in Tiny BustersOGDC 2014: Animation workflow with Spine in Tiny Busters
OGDC 2014: Animation workflow with Spine in Tiny BustersGameLandVN
 
OGDC 2014: Vietnam Smartphone game market 2013 overview
OGDC 2014: Vietnam Smartphone game market 2013 overviewOGDC 2014: Vietnam Smartphone game market 2013 overview
OGDC 2014: Vietnam Smartphone game market 2013 overviewGameLandVN
 
OGDC 2014: Speed up and make quality for your 3d models
OGDC 2014: Speed up and make quality for your 3d modelsOGDC 2014: Speed up and make quality for your 3d models
OGDC 2014: Speed up and make quality for your 3d modelsGameLandVN
 
OGDC 2014: Sky Garden Mobile conceptualization: From PC to Mobile
OGDC 2014: Sky Garden Mobile conceptualization: From PC to MobileOGDC 2014: Sky Garden Mobile conceptualization: From PC to Mobile
OGDC 2014: Sky Garden Mobile conceptualization: From PC to MobileGameLandVN
 
OGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototypeOGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototypeGameLandVN
 

More from GameLandVN (20)

Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian women
Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian womenMobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian women
Mobile Game Asia 2015 Ho Chi Minh City: Mobile games for Asian women
 
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...
Mobile Game Asia 2015 Ho Chi Minh City: Vietnam online mobile game market ins...
 
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in India
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in IndiaMobile Game Asia 2015 Ho Chi Minh City: Mobile game market in India
Mobile Game Asia 2015 Ho Chi Minh City: Mobile game market in India
 
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...
Mobile Game Asia 2015 Ho Chi Minh City: Building a sustainable eSports ecosys...
 
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...
Mobile Game Asia 2015 Ho Chi Minh City: An overview of the mobile game market...
 
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...
Mobile Game Asia 2015 Ho Chi Minh City: Monetization strategies in Southeast ...
 
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video ads
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video adsMobile Game Asia 2015 Ho Chi Minh City: Rewarded video ads
Mobile Game Asia 2015 Ho Chi Minh City: Rewarded video ads
 
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in VietnamMobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
 
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetization
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetizationMobile Game Asia 2015 Ho Chi Minh City: Predictive monetization
Mobile Game Asia 2015 Ho Chi Minh City: Predictive monetization
 
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creation
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creationMobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creation
Mobile Game Asia 2015 Ho Chi Minh City: The roadmap of IP creation
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureCloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with Azure
 
Windows app & Microsoft's support
Windows app & Microsoft's supportWindows app & Microsoft's support
Windows app & Microsoft's support
 
Kinh nghiệm phát triển Captain Strike
Kinh nghiệm phát triển Captain StrikeKinh nghiệm phát triển Captain Strike
Kinh nghiệm phát triển Captain Strike
 
Microsoft BizSpark
Microsoft BizSparkMicrosoft BizSpark
Microsoft BizSpark
 
Microsoft Azure Introduction
Microsoft Azure IntroductionMicrosoft Azure Introduction
Microsoft Azure Introduction
 
OGDC 2014: Animation workflow with Spine in Tiny Busters
OGDC 2014: Animation workflow with Spine in Tiny BustersOGDC 2014: Animation workflow with Spine in Tiny Busters
OGDC 2014: Animation workflow with Spine in Tiny Busters
 
OGDC 2014: Vietnam Smartphone game market 2013 overview
OGDC 2014: Vietnam Smartphone game market 2013 overviewOGDC 2014: Vietnam Smartphone game market 2013 overview
OGDC 2014: Vietnam Smartphone game market 2013 overview
 
OGDC 2014: Speed up and make quality for your 3d models
OGDC 2014: Speed up and make quality for your 3d modelsOGDC 2014: Speed up and make quality for your 3d models
OGDC 2014: Speed up and make quality for your 3d models
 
OGDC 2014: Sky Garden Mobile conceptualization: From PC to Mobile
OGDC 2014: Sky Garden Mobile conceptualization: From PC to MobileOGDC 2014: Sky Garden Mobile conceptualization: From PC to Mobile
OGDC 2014: Sky Garden Mobile conceptualization: From PC to Mobile
 
OGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototypeOGDC 2014: One-Man Studio: How to make a game prototype
OGDC 2014: One-Man Studio: How to make a game prototype
 

OGDC 2014: Program farmery by cocos2dx