FishyW / engine

boring stuff nothin to see here
MIT License
0 stars 0 forks source link

Project Initializer #7

Open FishyW opened 7 months ago

FishyW commented 7 months ago

Project Initialization

When the user clicks on "Select Project", it opens the project if the folder has a engine.config.json file with the following structure.

{
    "name": "project",
    "type": "engine"
}

Note that the type have to have the value "engine", the name is the name of the folder. This engine.config.json is used to store project configurations, it is also used to identify that the current project is an engine project.

If this file exists but it is incorrect, alert() the user that the project is invalid.

Creating a new project

If this file doesn't exist, then create a new project. This is done through the following steps.

  1. The template of the project is fetched from the internet and downloaded.
  2. The project template is unzipped to the corresponding directory.

The zip template of the project should be (if possible) stored inside of Github inside of template.zip in the root directory of this repository. Additionally, provide a utility task (write it inside of TaskFile.yml) that zips a folder called template. This utility task allows us to run task zip-template (change the name if you want) that zips the template folder.

Template Folder Contents

The template folder should contain the following files/folder. Files without extensions are folders.

- assets/
- src/components/
- src/objects/
- src/actions/
- src/events/
- src/managers/
- src/engine/
- src/engine/scenes/
- src/lib.rs
- engine.config.json
- Cargo.toml

The contents of lib.rs should be roughly the same as the contents of project/src/lib.rs.