@marcg11 的回答对 Cocos2d-x版本 2.*有效。3.1 版create_project.py
中不再存在脚本。您应该改用“cocos”控制台。
例如,在终端中,转到您要在其中创建项目并运行的文件夹:
cocos new Cocos2DxFirstIosSample -l cpp -p org.cocos2d.Cocos2DxFirstIosSample
您还可以指定其他参数:
$ cocos new --help
usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
[-t TEMPLATE_NAME] [--no-native]
[PROJECT_NAME]
Creates a new project
positional arguments:
PROJECT_NAME Set the project name
optional arguments:
-h, --help show this help message and exit
-p PACKAGE_NAME, --package PACKAGE_NAME
Set a package name for project
-l {cpp,lua,js}, --language {cpp,lua,js}
Major programming language you want to use, should be
[cpp | lua | js]
-d DIRECTORY, --directory DIRECTORY
Set generate project directory for project
-t TEMPLATE_NAME, --template TEMPLATE_NAME
Set the template name you want create from
lua/js project arguments:
--no-native No native support.