Developer Android Game Using Cocos2d-x
0. Environment
Windows 7x64
Visual Studio 2013
Adt-bundle-windows-x86 (http://developer.android.com/sdk/index.html)
Android-ndk-r8e
Python 2.7.3
Cocos2d-x-2.2.4
1. Steps
1.1 Install Python, Cocos2d-x, Eclipse ADT bundle, NDK. And add environment variables "Path" with value"X: \ Python27"
1.2 [Create Project]: In"X: \... \ cocos2d-x-2.2.4 \ tools \ project-creator"Folder, using command line to create a project.
create_project.py -project MyGame -package com.MyCompany.AwesomeGame -language cpp
The new project can be found in folder"X: \... \ cocos2d-x-2.2.4 \ projects".
1.3 [Develop game in Visual Studio]: Open"X: \... \ cocos2d-x-2.2.4 \ projects \ MyGame \ proj. win32 \ MyGame. sln"To develop your game.
1.4 [Install and set up Cygwin]:
1.4.1 Install Cygwin with packages: autoconf, automake, binutils, gcc-core, gcc-g ++, gcc4-core, gcc4-g ++, gdb, pcre, pcre-devel, gawk, make.
1.4.2 Add environment variables "Path" with value"X: \ cygwin \ bin"
1.4.3 Add line"X: \ Cygwin \ etc \ fstab"File
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
1.5 [Set up Eclipse environment]:
1.5.1 In "Window-> Preferences-> General-> Workspace-> Linked Resources" add a Path Variable "COCOS2DX" pointing to the root cocos2d-x directory"X: \... \ cocos2d-x-2.2.4"
1.5.2 In "Window-> Preferences-> C/C ++-> Build-> Environment" add a variable "NDK_ROOT" pointing to the root NDK directory"X: \... \ android-ndk-r8e", And add new variables" CYGWIN "with value" nodosfilewarning "and" SHELLOPTS "with value" igncr"
1.6 [Import libcocos2dx]: Import a project "libcocos2dx" from"Cocos2d-x-2.2.4 \ cocos2dx \ platform \ android \ java"
1.7 [Import your game project]: Import your game project from"X: \... \ cocos2d-x-2.2.4 \ projects \ CynTest02 \ proj. android"
1.8 Debug or run your game
2. References
[1] http://www.cocos2d-x.org/docs/manual/framework/native/v2/getting-started/setting-up-development-environments/windows-7-environment-setup/how-to-set-up-the-android-cocos2d-x-development-environment-on-windows7/zh
Cocos2d-x-2.2.4 \ projects \ MyGame \ proj. android \ README. md
(This article is from http://www.cnblogs.com/chenyineng/p/3828947.html, and belongs to http://chenyineng.cnblogs.com and http://www.chenyineng.info)