Javascript Game Engine
The build script outputs this project in three different ways:
- The
tsc
compiled source with*.d.ts
type declarations and source maps. Uses CommonJS module syntax to support the majority of bundlers/tools. - Same as above, but with ES2015 module syntax, to enable tree shaking.
- A
UMD
bundle, compiled to ES5, for use in browsers.
See this article for a more detailed explanation.
src/
├── Components/
│ ├── Health.ts
│ ├── Weapon.ts
│ ├── PlayerController.ts
│ └── EnemyController.ts
├── Prefabs/
│ ├── Player.ts
│ └── Enemy.ts
├── Scenes/
│ ├── LevelOne.ts
│ └── LevelTwo.ts
└── index.ts
If a component is only used in a single entity, it is ok to put it inside the same file as the prefab.