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

@@ -1,5 +1,5 @@
import random as r
import sys
import sys, os
from PIL import Image

def createDungeon(x=None, y=None, seed=None):
@@ -90,6 +90,8 @@ def main(x=None, y=None, seed=None, d_lmt=None, a_lmt=None, reps=None, out=None)
filename = []
for _ in range(16):
filename.append(r.choice(hexes))
if not os.path.exists("maps"):
os.makedirs("maps")
img.save('maps/{}.png'.format("".join(filename)))
print("Saved maps/{}.png".format("".join(filename)))


Loading…
Cancel
Save