This repository was archived by the owner on Mar 19, 2018. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMapGenerator.py
More file actions
Latest commit
55 lines (40 loc) · 1.21 KB
/
Copy pathMapGenerator.py
File metadata and controls
55 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
print("Setting up... \n");
fromPILimportImage
fromMapimport*
from_Generatorsimport*
fromClassesimport*
fromVectorMathimport*
image=Image.new("RGB", (mapSize,mapSize))
targetGenerator=None
# future multiproc stuff
#import multiprocessing
#
#
#def worker(index):
# print("worker spawned ",index)
# while(True):
# if (targetGenerator == None or targetGenerator.isFinished):
# break;
# targetGenerator.GenerateAutomated();
# for x in range(0, mapSize):
# for y in range(0, mapSize):
# im.putpixel((x,y), colorMap[x][y].GetTuple());
#threadsAmount = 1
#threads = []
#if __name__ == '__main__':
# for i in range(threadsAmount):
# print("starting process ", i);
# t = multiprocessing.Process(target=worker, args=(i,))
# threads.append(t)
# t.start()
# for i in range(threadsAmount):
# threads[i].join();
targetGenerator=MapGen_Main();
print("Generating... \n");
targetGenerator.GenerateFull();
print("\n\nGeneration finished. Saving output as Generated.png.");
forxinrange(0, mapSize):
foryinrange(0, mapSize):
image.putpixel((x,y), colorMap[x][y].GetTuple());
image.save("Generated.png");
image.show();