-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
43 lines (31 loc) · 1.23 KB
/
Main.py
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
__author__ = 'Ian'
import Generators
import Modifiers
import MapUtility
import random
from TerrainMap import TerrainMap
RESOLUTION = 512
randomOffset = (random.randint(-500, 500), random.randint(-500, 500))
noise = Generators.generateNoise(RESOLUTION, randomOffset, 2, 256.0)
radial = Generators.generateRadial(RESOLUTION, 3.0, 2.0)
randomOffset = (random.randint(-500, 500), random.randint(-500, 500))
detailNoise = Generators.generateNoise(RESOLUTION, randomOffset, 6, 128.0)
height = Modifiers.subtract(radial, noise)
height = Modifiers.subtract(height, detailNoise)
terrainMap = TerrainMap(height, 0.1)
terrainMap.generate_rivers(0.2, 0.002)
terrainMap.calculate_rainfall()
terrainMap.calculate_temperature()
terrainMap.calculate_biomes()
img = terrainMap.get_terrain_map_image()
img.save("test.png", "PNG")
height_map = terrainMap.get_height_map_image()
height_map.save("height.png", "PNG")
water_map = terrainMap.get_water_map_image()
water_map.save("water.png", "PNG")
temperature_map = terrainMap.get_temperature_map_image()
temperature_map.save("temperature.png", "PNG")
rainfall_map = terrainMap.get_rainfall_map_image()
rainfall_map.save("rainfall.png", "PNG")
biome_map = terrainMap.get_biome_map_image()
biome_map.save("biome.png", "PNG")