1. Home
  2. Docs
  3. In-game implementation
  4. JSON overview
  5. “levels” section

“levels” section

The levels field in the root of the JSON contains the most important data for game devs: actual levels content 🙂

Each level contains an array of layerInstances that look like this:

"layerInstances": [
	{
		"__identifier": "IntGrid",
		"__type": "IntGrid",
		"__cWid": 16, // layer width (grid based)
		"__cHei": 16, // layer height (grid based)
		"__gridSize": 16,
		"levelId": 0,
		"layerDefUid": 1,
		"pxOffsetX": 0, // optional offset that could happen when resizing levels
		"pxOffsetY": 0, // same
		"seed": 7382459,
		"intGrid": [], // only populated if layer is an IntGrid
		"autoTiles": [], // only populated if layer is an Auto-layer
		"gridTiles": [], // only populated if layer is a TileLayer
		"entityInstances": [] // only populated if layer is an EntityLayer
	}
]