-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
48 lines (43 loc) · 1.33 KB
/
main.go
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
package main
import (
"fmt"
"strconv"
"github.com/camberlucian/go-world-generator/geogen"
"github.com/camberlucian/go-world-generator/render"
)
func main() {
GenerateWorld()
}
func GenerateWorld() {
fmt.Println("GENERATING WORLD")
world := geogen.GenerateBasicMap(50, 50, -8, 8, "fullmap")
fmt.Println("NORMALIZING ELEVATION")
world = geogen.NormalizeElevation(world, 3)
fmt.Println("GENERATING COASTS")
world = geogen.GenerateCoastalOffset(world, 0, 8, 8, 0, 7)
fmt.Println("FLOODING MAP")
world = geogen.FloodMap(world)
fmt.Println("REMOVING OUTLIERS")
world = geogen.RemoveOutliers(world, 20)
fmt.Println("REMOVING SMALL LAKES")
world = geogen.RemoveSmallLakes(world, 2)
fmt.Println("REMOVING OUTLIERS")
world = geogen.RemoveOutliers(world, 1)
world = geogen.RemoveSmallLakes(world, 2)
world = geogen.RemoveOutliers(world, 1)
world = geogen.RaiseLand(world, 1)
world = geogen.RemoveCoastalPeaks(world, 1)
peaks := geogen.FindPeaks(world, 4)
fmt.Println("PEAK COUNT: " + strconv.Itoa(len(peaks)))
world = geogen.MakeMountainsFromPeaks(world, peaks)
world = geogen.DisperseHumidity(world, false, true, true, false)
fmt.Println("PRINTING MAP")
//
err := render.DrawHumidityMap(world, 50)
err = render.DrawElevationMap(world, 50)
if err != nil {
fmt.Println("ERROR: " + err.Error())
} else {
fmt.Println("DONE")
}
}