Quick Start
This walks through a first moving entity: add it in the editor, then drive it with a system written in TypeScript.
-
Create a project. In the editor, click New project, pick the Blank starter template, name it, and click Create project. You get a default scene with a Camera entity. (The Examples templates are full sample projects if you’d rather explore a finished game.)
-
Add an entity. In the scene hierarchy, add an entity and give it a
Spriteand aTransformcomponent in the inspector. -
Write a system. Add a TypeScript file to your project’s scripts and register a system that moves everything with a
Speedcomponent:import {defineComponent, defineSystem, addSystem,Query, Mut, Res, Time, Transform} from 'esengine';const Speed = defineComponent('Speed', { value: 200 });addSystem(defineSystem([Res(Time), Query(Mut(Transform), Speed)],(time, query) => {for (const [entity, transform, speed] of query) {transform.position.x += speed.value * time.delta;}})); -
Preview. Save the script — the editor watches your project’s scripts and, a moment later, extracts your component definitions, so
Speedappears in the inspector’s Add Component list automatically. AddSpeedto your entity, then press F5 to run the scene. The sprite moves.