Files
Elvenbane/res/maps/map_editor.py
2026-02-16 01:31:16 +03:00

19 lines
425 B
Python

import json
from copy import deepcopy
width = 100
height = 100
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)