December 27, 2015

Setup Cocos2d-x 3.9 Part 4: Build Cocos2d-x game project.

This is the part 3 of series "Setup Cocos2d-x 3.9". You need to complete the previous parts before working on this part. Take a look part 1 and part 2 first:

In the previous part, I did set-up all tools as well as settings. Now, we are all set to play with Cocos2d-x. In this part, I will create the Cocos2d-x project with Console commands and build it. Let's get started!

Step 1: Locate to path: "C:\Android\cocos2d-x-3.9\tools\cocos2d-console\bin" with command:

cd C:\Android\cocos2d-x-3.9\tools\cocos2d-console\bin


Step 2: Type command: cocos new YumikiTutorial -l cpp -p com.yumiki.tutorial -d C:\Games


With:
cocos: this will call Python file "cocos.py" located in "C:\Android\cocos2d-x-3.9\tools\cocos2d-console\bin"
new: is the parameter to create new project. After keyword "new" is the name of project. I name it to "YukimiTutorial"
-l: the programming language selection parameter, we can select cpp/lua/js.
-p: package name parameter, here I selected the package name is com.yumiki.studio
-d: the directory to store the project

After running that command, Cocos2d-x will copy a number of files to create project.

I did set-up and create the Cocos2d-x project successfully. When you open the project, you will see it generated vary OS platform such as Android Studio, iOS, Linux and Windows. Now you can work on any platform you want. In the next tutorials, I will set-up to work with Cocos2d-x on Android Studio.
If you have any questions or concerns, please post your comments here, I will take a look and response ASAP.


Yumiki.

No comments :

Post a Comment