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.
28 lines
547 B
28 lines
547 B
extends Control
|
|
|
|
var thread
|
|
var world = {}
|
|
|
|
func _ready():
|
|
thread = Thread.new()
|
|
thread.start(self, "_generate_world")
|
|
set_process(true)
|
|
#
|
|
# while true:
|
|
# if "step" in world:
|
|
# if world.step >= world.max_step:
|
|
# break
|
|
# print(world.step)
|
|
# $ProgressBar.value = world.step / world.max_step * 100
|
|
|
|
func _process(delta):
|
|
if "step" in world:
|
|
print(world.step)
|
|
if world.step >= 2:
|
|
get_tree().change_scene("res://world/game.tscn")
|
|
|
|
func _exit_tree():
|
|
thread.wait_to_finish()
|
|
|
|
func _generate_world():
|
|
world = WorldGeneration.new()
|
|
|