Egret provides a very convenient creation tool, and we call the sum of created files a project. In the following operations, we operate on the created project. The specific creation steps are as follows:
It should be noted that Egret supports two platforms: Windows and Mac OS X. The Egret command we use is the same in different platforms. For different commands, you can refer to the operation introduction of the relevant platforms in the document.
When creating Egret, you need to specify the directory where the project is created. Egret will store all created project files in the specified directory.
1. Enter the project directory in Windows system
We typed the command in the command line tool in Windows as shown in the following figure:
2. Enter the project directory in Mac OS X system
We create a folder in Mac OS X with the name egretdemo. The folder path is: /Volumes/mac1/egretdemo/
Use the cd command in the terminal to locate the current directory, cd /Volumes/mac1/egretdemo/
3. Create Hello World Project
Below we create our project through the tools provided by egret, and we call the current project name "HelloWorld". Use the command in the terminal: egret create HelloWorld.
After a few seconds, the egret tool will create a project named "HelloWorld" in the directory we have formulated. In the directory you have created, the project created by egret will be the same as the project name. You will see a folder named "HelloWorld" in the specified /Volumes/mac1/egretdemo/ directory. Therefore, all files of the current project are present in this folder.
In the generated project folder we will see four subfolders.
workspace // egret workspace |-- HelloWorld // Game project |-- src // Game code directory, the source code is stored in this directory, and the file suffix is `.ts`. |-- resources // The game resource directory stores the resources used by the game, including picture files, audio files, resource configuration files, etc. |-- launcher // Game portal, all web files that can run and view game effects are stored in this folder. |-- index.html //Start file |-- libs //egret engine library file |-- bin-debug // The compiled code directory stores the code in the current debug mode. Most of the code in this folder is `.js` file. |-- egretProperties.json //Egret project compilation parameters