Files
Elvenbane/res/maps/map_editor.py

19 lines
422 B
Python

import json
from copy import deepcopy
width = 10
height = 8
grass_def = {"id": "1", "name": "2", "sprite_name": "grass_small"}
cell_def = {"terrain_obj": grass_def, "item_obj": {}, "creature_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)