/egret-core

Egret is a brand new open mobile game and application engine which allows you to quickly build mobile games and apps on Android,iOS and Windows.

Primary LanguageJavaScriptOtherNOASSERTION

forks stars version license

EN / CN

Egret Engine

The Egret Engine includes a game engine that follows the HTML5 standard developed by the Egret. It includes a common module for game engines such as 2D / 3D rendering cores, EUI systems, audio management, and resource management. Through the use of Egrets engine, developers can do as much as possible not concerned about the bottom of the browser to achieve, to solve the HTML5 game performance problems and fragmentation issues, flexibility to meet the developer to develop 2D or 3D game needs.

Platform Coverage

Mobile

PC

Installation

Install Egret Engine

After installation, we can easily manage the Egret engine and tools.

Getting Started

TypeScript

An Egret project should be developed by TypeScirpt language. TypeScript is a superset of JavaScript, the specific content can refer to the TyptScript language manual. Egret API and AS3 have a lot of similarities. It will be certainly easy to get started if you are familiar with it.

Create a project by command line

You can use following command to create a default item for the game

egret create HelloWorld

If you have special needs you can add parameters - type empty | game | gui | eui to specify different projects. After creating a game you can see a folder named 'HelloWorld'.

Write the first line of code

The entry for the game project is src / Main.ts by default. Write the first line of code for our project below, find the createGameScene () function in the default code, add console.log ("Hello World");

Become following:

private createGameScene():void {
        // log
        console.log("Hello World");
        var sky:egret.Bitmap = this.createBitmapByName("bgImage");
        this.addChild(sky);
        var stageW:number = this.stage.stageWidth;
        var stageH:number = this.stage.stageHeight;
        sky.width = stageW;
        sky.height = stageH;
        //...
    }

Here we call a commonly used debugging command, console.log ("need to display the log content"). It will display our log in the browser's developer tool.

We recommend using Chrome to debug the Egret project.

We use the following command to build the project:

egret build

Then use the following command line to run the project:

egret startserver

Done.

For more information, please refer to the Learning Module to view the documentation.

Demo

Tower Defence Demo Click here for online experience.

Click here for more 2D/3D demos.

Show Case

Click here to see Show Case

Learn

  • Access Doc to get Engine document
  • Access Example to learn demo source code
  • Access API to get API document
  • Access Video to get videos
  • Access Community to communicate with other developers

Tools

Third Party Library

  • Use base64texture to convert base64 String to egert Texture
  • Use dcagent DataEye SDK for Egret
  • Use ecs component system
  • Use euiextension EUI extension
  • Use gesture Gesture library
  • Use keyboard Keyboard event listener
  • Use Greensock Greensock animation library
  • Use jszip jszip Compression library
  • Use md5 A simple MD5 Library
  • Use mouse PC mouse support library
  • Use particle particle system
  • Use physics p2Physics engineļ¼Œcurrent version 0.7.0
  • Use socket socket.io
  • Use tiled tiledmap support library
  • Use weixinapi WeChat API
  • More third party libraries please visit here

Contributing

Raising a good question is the first step to participate a open source community. You can report issues here. Issue discussion in official community is recommended. It can help the latters solve problems more efficiently.

License

This content is released under the (https://opensource.org/licenses/BSD-2-Clause) BSD License.