More Related Content
Similar to OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr. Vu Ngoc Kien
Similar to OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr. Vu Ngoc Kien (20)
OGDC 2014_Hands on experience with Cocos2dx in cross-platform with Farmery_Mr. Vu Ngoc Kien
- 3. 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
- 5. 2D Cross-Platform engine game
Open source
High performance
Using cocos2d-ios documents as APIs are
similar
Many support tools
Advantages
- 6. Not easy
Many choices: C++, Lua, Java Script
Use C++ language
Require understandings of different
platforms setup
Approach Cocos2d-x
- 7. 1. Animation in Farmery game
2. Multiscreen in Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
- 8. Over 125 animations in game
Optimize to save memory
1. Animation in Farmery
- 16. Using flash in animation
Import PSD Layer
Support pictures skewing
Advantages
- 17. 1. Animation in Farmery game
2. Multi screen in Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
- 18. 2. Multi screen in Cocos2d-x
480 x 320
2048 x 1536
1136 x 640
1080 x 1920
- 19. 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
- 23. contentScaleFactor = RH/DH, resource for screen suitably
contentScaleFactor = (RH/DH)/ (MIN(fScaleX, fScaleY) /
MAX(fScaleX, fScaleY)).
fScaleX = FW/ DW; float fScaleY = FH/DH.
contentScaleFactor
- 25. 1. Animation in Farmery game
2. Multiscreen by Cocos2d-x
3. Debug Cocos2d-x on Android
Farmery development using
Cocos2d-x
- 29. Use Android GCC tool chain
(properties -> C/C++ Build -> Tool Chain Editor)
Edit Project Properties
- 30. • Setting build command: ndk-build NDK_DEBUG=1 –j8
(properties -> C/C++ Build -> Builder Setting)
Edit Project Properties
- 32. 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
- 35. 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