OGDC 2014: Program farmery by cocos2dx
-
Author
gamelandvn -
Category
Documents
-
view
2.272 -
download
3
Embed Size (px)
Transcript of OGDC 2014: Program farmery by cocos2dx
- 1. Farmery development using cocos2d-x Vu Ngoc Kien - Game Studio North / VNG
2. Farmery Game 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 4. Cocos2d-x - Cross platform game engine 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 9. Frame-By-Frame Animation 64 pictures, 2MB 10. Tween Animation 5 pictures, 240 KB 11. Make Animations using Dragon Bone http://dragonbones.github.io 12. Artists produce objects parts 13. Assemble animations on Flash 14. Extract animation file using Dragon Bone 15. Result 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 20. Picture looks stretched Exact fit 21. 2 black edges on the screen Show all 22. No border 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 24. Farmery displays well on different screen sizes 25. 1. Animation in Farmery game 2. Multiscreen by Cocos2d-x 3. Debug Cocos2d-x on Android Farmery development using Cocos2d-x 26. Require Cygwin, NDK Setup NDK path Cant debug native Build cocos2d-x on Android by Cygwin on Windows 27. Build cocos2d-x on Android by eclipse Not require Cygwin Can debug native 28. Undefined Cygwin (properties -> C/C++ Build -> Environment) Edit Project Properties 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 31. Link Classes folder (properties -> C/C++ General -> Paths and Symbols -> Source Location) 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 33. Crash will show on LogCat 34. Use Breakpoint to debug 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 36. Farmery development using cocos2d-x Vu Ngoc Kien [email protected] (Game Studio North /VNG)