Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

白鹭引擎无废话快速上手 #11

Open
SiZapPaaiGwat opened this issue Apr 29, 2015 · 0 comments
Open

白鹭引擎无废话快速上手 #11

SiZapPaaiGwat opened this issue Apr 29, 2015 · 0 comments

Comments

@SiZapPaaiGwat
Copy link
Owner

如果你从未听说白鹭引擎,也不了解其用途,那么本文可能并不适合你。阅读之前请确保你已了解白鹭引擎是一套基于TypeScript的游戏开发引擎,本文讲述了使用白鹭引擎开发HTML5项目的一般流程。

安装白鹭引擎

安装很简单,不论是windows还是mac,前往官网下载白鹭引擎的安装包,解压安装即可。参考链接:

友情提示:至本教程完成时,白鹭引擎尚未提供适用于Linux系统的安装包。

验证安装过程

安装完成之后,打开终端输入egret,命令行会展示用法提示以及command列表。

如果egret命令未找到,说明你的安装过程出错了。

白鹭引擎的命令行工具是基于Node.js开发的,其源代码也是开源的。如果对某个命令有疑问或者对其实现感兴趣,可以直接查看其源代码更为方便。具体位置在白鹭引擎安装路径下的/egret/tools/lib/tools,比如build.jspublish.js分别对应egret buildegret publish命令。或者前往GitHub查看https://github.com/egret-labs/egret-core/tree/master/tools/lib/tools

创建项目

egret create HelloWorld

编译项目

egret build HelloWorld

将TypeScript的源代码编译为原生JavaScript代码,默认编译为HTML5项目。如果需要编译为native项目,则加上--runtime native参数。

运行项目

egret startserver HelloWorld

白鹭引擎内部创建了一个基于Express的WebServer,当运行此命令后会自动在默认浏览器中打开项目首页。

发布项目

egret publish HelloWorld

其它

HelloWorld之后继续深入,请阅读http://docs.egret-labs.org/post/quitestart/helloworld/helloworld2.html

白鹭引擎相关开源项目:https://github.com/egret-labs

关于TypeScript

如果读者需要使用白鹭引擎开发游戏,那么系统地学习TypeScript是必经之路。虽然TypeScript的入门门槛不算高,但是完全掌握也需不少时间,不过对于开发一款游戏来说,掌握这门语言带来的收益应该远远大于学习的成本。

@SiZapPaaiGwat SiZapPaaiGwat changed the title 白鹭引擎快速上手 白鹭引擎无废话快速上手 Apr 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant