OGDC 2014: Program farmery by cocos2dx
-
Upload
gamelandvn -
Category
Documents
-
view
2.277 -
download
3
Transcript of OGDC 2014: Program farmery by cocos2dx
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
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
Make Animations using Dragon Bone
http://dragonbones.github.io
1. Animation in Farmery game
2. Multi screen in Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using Cocos2d-x
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
contentScaleFactor = RH/DH, resource for screen suitably
contentScaleFactor = (RH/DH)/ (MIN(fScaleX, fScaleY) /
MAX(fScaleX, fScaleY)).
fScaleX = FW/ DW; float fScaleY = FH/DH.
contentScaleFactor
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
• 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
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