Develop Android Game Using Cocos2d-x
3471 단어 cocos2d-x
Windows 7 x64Visual Studio 2013adt-bundle-windows-x86 (http://developer.android.com/sdk/index.html)android-ndk-r8ePython 2.7.3cocos2d-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\MyGame\proj.android"
1.8 Debug or run your game
2. Problems
2.1 [undefined reference to 'MainMenu::scene()']In "X:\...\cocos2d-x-2.2.4\projects\MyGame\proj.android\jni\Android.mk", add new scenes cpp file to LOCAL_SRC_FILES, for example:
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp \
../../Classes/MainMenuScene.cpp \
../../Classes/IntroductionScene.cpp
3. 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 )
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Cocos Studio v3.x ListView에 PanelNode를 동적으로 추가해보기Cococs Studio에서 ListView를 설정한 BaseNode와 파트 부분이 되는 PasrtNode를 작성. ListView에 PasrtNode를 추가해 가고, 빨리 GridView적인 것을 만드는 비망록. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.