Browse Source

Creates the maps/ path if it doesn't exist

master
Noëlle Anthony 7 years ago
parent
commit
6635694611
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      procgen.py

+ 3
- 1
procgen.py View File

import random as r import random as r
import sys
import sys, os
from PIL import Image from PIL import Image


def createDungeon(x=None, y=None, seed=None): def createDungeon(x=None, y=None, seed=None):
filename = [] filename = []
for _ in range(16): for _ in range(16):
filename.append(r.choice(hexes)) filename.append(r.choice(hexes))
if not os.path.exists("maps"):
os.makedirs("maps")
img.save('maps/{}.png'.format("".join(filename))) img.save('maps/{}.png'.format("".join(filename)))
print("Saved maps/{}.png".format("".join(filename))) print("Saved maps/{}.png".format("".join(filename)))



Loading…
Cancel
Save