Files
Elvenbane/res/maps/map_editor.py
2026-02-14 03:09:52 +03:00

19 lines
445 B
Python

import json
from copy import deepcopy
width = 10
height = 8
grass_def = {"id": "1", "name": "2", "sprite": "grass_small"}
cell_def = {"type": "Ground", "cell": {"terrain_obj": grass_def, "creature_obj": {}, "item_obj": {}}}
out = {}
for i in range(0, height):
buff = []
for j in range(0, width):
buff.append(deepcopy(cell_def))
out[i] = buff
with open("def_map.json", "w") as file:
json.dump(out, file, indent = 4)