|
|
|
|
@ -14,7 +14,16 @@ export(int) var river_proba = 200 |
|
|
|
|
var rng = RandomNumberGenerator.new() |
|
|
|
|
var noise = OpenSimplexNoise.new() |
|
|
|
|
|
|
|
|
|
var thread |
|
|
|
|
|
|
|
|
|
func _ready(): |
|
|
|
|
thread = Thread.new() |
|
|
|
|
thread.start(self, "_generate_world") |
|
|
|
|
|
|
|
|
|
func _exit_tree(): |
|
|
|
|
thread.wait_to_finish() |
|
|
|
|
|
|
|
|
|
func _generate_world(): |
|
|
|
|
rng.randomize() |
|
|
|
|
noise.seed = rng.randi() |
|
|
|
|
noise.octaves = octaves |
|
|
|
|
@ -37,6 +46,7 @@ func _ready(): |
|
|
|
|
Global.print_debug("Pas de construction ..., pas de palais ...") |
|
|
|
|
Global.print_debug("Pas de palais ..., pas de palais.") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func init_data(): |
|
|
|
|
# for point in Global.terrain.get_points(): |
|
|
|
|
# point.set_elevation(point_find_elevation(point.point2d())) |
|
|
|
|
|