69 lines
1.5 KiB
Markdown
69 lines
1.5 KiB
Markdown
---
|
|
sidebar_position: 1
|
|
---
|
|
|
|
# Create The Project
|
|
|
|
The first step to start a new project.
|
|
|
|
When starting a new project, you'll be giving an empty repository.
|
|
|
|
Take the `Roma Legacy` game as an example.
|
|
|
|
## Clone Git repository
|
|
|
|
To clone this repository, run the following command:
|
|
|
|
```bash
|
|
git clone https://gitea.plp19.com/cocos-eanew/coc-roma-legacy.git
|
|
```
|
|
|
|
Once cloned, configure your Git user information (only needed the first time):
|
|
|
|
```bash
|
|
cd coc-roma-legacy
|
|
git config user.name "Your Git Username"
|
|
git config user.email "Your Email"
|
|
```
|
|
|
|
## Create Cocos Creator project
|
|
|
|
Inside `coc-roma-legacy` folder, create a `project.json` file:
|
|
|
|
```json title="project.json"
|
|
{
|
|
"engine": "cocos-creator-js",
|
|
"packages": "packages",
|
|
"name": "coc-roma-legacy",
|
|
"version": "2.4.4",
|
|
"isNew": false
|
|
}
|
|
```
|
|
|
|
Now you can open the project in `Cocos Creator`.
|
|
|
|
1. Launch **Cocos Dashboard**
|
|
2. Click **Add Project**
|
|
3. Navigate to **coc-roma-legacy** folder
|
|
4. Click **Select Project**.
|
|
|
|

|
|
|
|
Now that the project is available in `Cocos Dashboard`, double-click on it to open.
|
|
|
|
`Cocos Creator` will generate the entire game structure including `.gitignore` file.
|
|
|
|

|
|
|
|
## Commit to Git
|
|
|
|
At this point, you should create an initial commit and open your first `Pull Request`.
|
|
|
|
Run these following command:
|
|
|
|
```bash
|
|
git checkout -b feature/init-project
|
|
git add --a
|
|
git commit -m "Init cocos project"
|
|
git push --set-upstream origin feature/init-project
|
|
``` |