five-on-it / apps/tools/src/port-level
apps/tools/src/port-level
From level data to an editor scene: the block library, the kits the level's pieces come from installed under _kits, a group per kind and one instance of the right source per placed mesh, road (pitched along its climb), nail strip, spawn point, dummy, door, container, camera and NPC (their texts and numbers, a lock, the items, a patrol, on their block scripts), placed through the mirror into the editor's left-handed frame, plus a light and a camera so the scene renders. The scene is built in a headless Babylon engine and written as an editor project folder. A road with more than two points is laid as a chain of slabs (splitRoads); a recipe (recipe.ts) adds its pieces to the same scene.