You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
554 B
24 lines
554 B
extends Control
|
|
|
|
var thread
|
|
var world = {}
|
|
var old_step = 0
|
|
|
|
func _ready():
|
|
thread = Thread.new()
|
|
thread.start(self, "_generate_world")
|
|
set_process(true)
|
|
Global.loading.set_start_time()
|
|
|
|
func _process(_delta):
|
|
$ProgressBar.value = Global.loading.get_percentage()
|
|
if (Global.loading.get_end_time() > 0):
|
|
|
|
Global.print_debug("Elapsed time : %f seconds" % Global.loading.get_elapsed_time("s"))
|
|
get_tree().change_scene("res://world/game.tscn")
|
|
|
|
func _exit_tree():
|
|
thread.wait_to_finish()
|
|
|
|
func _generate_world():
|
|
world = WorldGeneration.new()
|
|
|