美文网首页我爱编程
cocos2d-js web 开发

cocos2d-js web 开发

作者: _韩小妖 | 来源:发表于2018-05-25 21:53 被阅读29次

1、创建项目

1) 下载地址 http://cn.cocos2d-x.org/download/ (目前最新版本3.3 375M左右)2)
2) 下载完成解压后, 打开终端, 进入到对应文件夹。

F2A073BA-438F-4A62-9A0F-833F1CCD05C7.png
  1. 执行
./setup.py  
image

期间会有几次询问,是设置安卓SDK路径的,不设置安卓直接Enter跳过即可

->Please enter the path of NDK_ROOT (or press Enter to skip):  
->Please enter the path of ANDROID_SDK_ROOT (or press Enter to skip):  
->Please enter the path of ANT_ROOT (or press Enter to skip):  

之后就OK了,会有提示:

Please execute command: "source /Users/apple/.bash_profile" to make added system variables take effect  

照着输入 source /Users/apple/.bash_profile 就好了

4)开始创建工程
进到bin文件夹下

cd tools/cocos2d-console/bin

5)终端输入

cocos new 项目名称 -l js -d /Users/+具体地址

然后就可以在对应目录下看到了

2、运行

cocos run -p web|ios|android

3、编译到指定目录

cocos compile -p web -m release -o /Users/hanyanzhi/Downloads/han

参考文献
https://blog.csdn.net/hitwhylz/article/details/41988349

相关文章

网友评论

    本文标题:cocos2d-js web 开发

    本文链接:https://www.haomeiwen.com/subject/zcxpjftx.html