πΊοΈ Level Schema
Defines each game levelβs layout, objects, transitions, and unlock logic.
β Field Rules & Accepted Values
| Field | Type | Required | Notes |
|---|---|---|---|
| id | number | β Yes | Unique level ID |
| name | string | β Yes | Level title (UI-friendly) |
| description | string | β No | Shown in menu |
| size | {width, height} | β Yes | In tiles or pixels |
| entryPoint | {x, y} | β No | Player spawn location |
| music | string | β No | Background music file or ID |
| background | string | β No | Skybox or parallax image |
| tilemap | string | β No | Optional layout source |
| tokens | string[] | β Yes | Placed token IDs (from TOKENS) |
| npcs | string[] | β Yes | NPCs placed (from NPC schema) |
| enemies | string[] | β Yes | Enemy IDs (from ENEMIES) |
| events | string[] | β No | Cutscenes or triggers |
| locked | boolean | β No | Defaults to false |
| unlockCondition | object | β No | e.g. { questCompleted: 'intro_mission' } |
| exits | array | β No | Level links: { toLevel, position, spawnPoint } |