Skip to content

Make a new level

Levels are built from text rows with build_level; the characters come from game/levels/legend.json. In the platformer template: # ground, / \ slopes, = one-way plank, ^ spikes, X block, P player, $ coin, H heart, M mushroom, Q bee, C checkpoint, G goal (2 tiles tall), and decorations (, r y B…).

{
"id": "level-2",
"name": "Level 2",
"rows": [
"..............................",
"..............$$$.............",
".............=====............",
"..P....$$...........M....G....",
"######..####^^################",
"######..######################"
]
}

Rules for rows: all the same length (otherwise the tool reports e.g. Row 5 is 34 characters wide; row 0 is 30), the player on solid ground, gaps at most 4 tiles wide and steps at most 3 tiles high (jump height is about 4 tiles). Columns 6–7 above are a pit (falling in costs a life); ^ spikes hurt and bounce the player.

Then make a scene for it: copy the level-1 scene with id: "level-2" and level: "levels/level-2.json" (upsert_scene), and point level 1’s goal rule at it: { "action": "goToScene", "scene": "level-2", "delayMs": 2800 }. Check that the level can be finished by holding right and jumping at the right moments with run_headless, or at least that player.Transform.x increases and no errors appear.