๐งโโ๏ธ 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" } |