Develop Android Game Using Cocos2d-x

來源:互聯網
上載者:User

Develop Android Game Using Cocos2d-x

0. Environment

Windows 7 x64
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 to "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 "X:\...\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
[2] 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)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.