I do not know the cocos2d-x from the first few versions to create a project with python, anyway, I recently downloaded the cocos2d-x-2.2.1 is to create with python, basically is a sentence to help us get it done, saves us a lot of trouble.
The procedure for creating a windows instance is as follows:
Open the windows command line, open the directory to cocos2d-x-2.2.1 \ cocos2d-x-2.2.1 \ tools \ project-creator, and then directly call create_project.py, it will give you the following prompt:
I wrote this sentence to create a lua project:
Create_project.py-project: MyGame-package com. MyCompany. AwesomeGame-language lua
Then you will see "Have Fun!" at the end !" (I forgot to say my python is 2.7)
At the same time, it will create the project under the projects directory of your cocos2d-x2.2.1, and normally, we do not put the project here, because if we want to update a later version, it's hard to copy it to a later version directory. Of course not, therefore, we have to separate the created Project.
The procedure is as follows:
(1) define system environment variables (the variable value is the path of the cocos2dx library on my computer)
Variable name: COCOS2DX_ROOT
Variable values: D: \ project \ libraries \ cocos2d-x-2.2.1 \ cocos2d-x-2.2.1
(2) copy the project you just created to the desired place (as long as it is not under the cocos2d-x2.2.1 directory)
(3) Open the project under the proj. win32 Directory under the project: MyGame. vcxproj
You can see after libBox2D, libchipmunk, libcocos2d, libCocosDenshion, libExtensions, and liblua
It doesn't matter if they are all unavailable. Just remove them and add them one by one.
(4) Right-click the project (MyGame)-> properties-> Configuration properties-> C/C ++-> General, select "add include directory"-> edit on the right, except $ (ProjectDir ).. except \ Class, other $ (ProjectDir ).. \.. \.. change
The environment variable $ (COCOS2D_ROOT) We just defined is before and after the change:
Before change:
After the change:
(5) click OK and then select ky "http://www.bkjia.com/kf/web/php/" target = "_ blank" class = "keylink"> PHPwtfzsd + fill + obDUpM/fill + 1 xKGww/fill + 86qo7o8L3A + Cgo8cD4gICAgeGNvcHkg "$ (COCOS2DX_ROOT) \ scripting \ lua \ script "" $ (ProjectDir ).. \ Resources "/e/Y
(6) Click "OK" and select "generate event"-> "pre-linked event" on the left, and select "command line"-> "edit" on the right ", it also sets "$ (ProjectDir ).. \.. \.. "with" $ (COCOS2DX_ROOT) ", the result is:
If not exist "$ (OutDir)" mkdir "$ (OutDir )"
Xcopy/Y/Q "$ (COCOS2DX_ROOT) \ external \ libwebsockets \ win32 \ lib \ *. *" "$ (OutDir )"
(7) be sure, run, and make it easy. (5) and (6) the two sentences I found are really hard, at the beginning, I didn't know where to configure it. I had to spend 2 or 3 minutes, and I decided to record it.