跨平台环境的搭建
1、去网址:http://www.cocos2d-x.org/download,下载最新的cocos2d-x-3.0.zip ,解压zip文件,将解压后的文件放到文稿中。
2、启动终端(点击Finder-前往-实用工具-终端)。
3、在终端中输入:cdDocuments/ cocos2d-x-3.0,回车
4、在终端中输入:./setup.py,回车
5、iOS中跳过让输入路径的几个步骤。环境搭建结束。
6、新建工程。在终端中输入:cocos new hello -l cpp -p com.neworigin.hello–d /Users/apple/Desktop/ (其中的hello是工程名,/Users/apple/Desktop/是工程的存放位置)。回车。
7、这样对应的目录中就会有新工程,双击.xcodeproj文件。
也即:
一、配置cocos2d-x 3.0
1、cd /Users/student/Desktop/cocos2d-x-3.1
2、ls
3、./setup.py
4、回车3次
5、source /Users/student/.bash_profile
6、cd ~
7、open .bash_profile
配置结束了
二、新建项目:
1、cocos new
2、cocos new Test -p a.a.a -l cpp -d /Users/student/Desktop/cocos2d-x3.0project (路径为新建的文件夹)