🗺️ 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 } |