🧍♀️ Player Schema
Defines the main playable character’s stats, sprite, and controls.
✅ Field Rules & Accepted Values
Field | Type | Required | Notes |
---|---|---|---|
id | string | ✅ Yes | Unique internal identifier (e.g., 'main_character'). Used in logic. |
displayName | string | ✅ Yes | Name shown in the game UI (e.g., 'Ayla'). |
health | number | ✅ Yes | Starting HP (integer). |
speed | number (float) | ✅ Yes | Horizontal movement speed (e.g., 1.0). |
jumpStrength | number (float) | ✅ Yes | Jump height/power. |
gravityScale | number (float) | ✅ Yes | Multiplier for gravity (e.g., 1.0 = normal). |
collides | boolean | ✅ Yes | If true, interacts with platforms, walls, enemies. |
invincible | boolean | ✅ Yes | If true, cannot take damage. |
abilities | string[] | ✅ Yes | List of ability IDs (must match abilities schema). |
sprite | string | ✅ Yes | Sprite file (e.g., 'ayla.png'). |
size | object | ✅ Yes | Physical dimensions in pixels. |
controls | object | ✅ Yes | Key mappings for ability/action triggers. |
👤 player (global)
Defines the main playable character. This config connects with movement, abilities, UI, and game logic.
Field | Type | Description | Required | Example |
---|---|---|---|---|
id | string | Unique reference used in logic and events. | ✅ | "main_character" |
displayName | string | Optional in-game name shown in dialog/UI. | ❌ | "Ayla" |
health | number | Starting health (can be 0–100+ depending on gameplay). | ✅ | 100 |
speed | number | Movement speed multiplier (1.0 = default). | ✅ | 1.0 |
jumpStrength | number | Vertical force applied when jumping. | ✅ | 2.0 |
gravityScale | number | Affects fall rate (1 = normal, <1 = floaty, >1 = heavy). | ✅ | 1.0 |
collides | boolean | Whether player can collide with world geometry. | ✅ | true |
invincible | boolean | If true, takes no damage (e.g. cutscene/cheat). | ❌ | false |
abilities | string[] | List of ability IDs from the abilities schema. | ✅ | ["dash", "jump"] |
sprite | string | Path to character sprite asset. | ✅ | "ayla.png" |
size | object | Physical collision box in pixels. | ✅ | { "width": 32, "height": 48 } |
controls | object | Maps abilities to keyboard/controller keys. | ❌ | { "dash": "X" } |