parent
b862b7361c
commit
b4180e66ca
@ -0,0 +1,28 @@ |
||||
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() |
||||
@ -1,8 +1,8 @@ |
||||
[gd_scene load_steps=2 format=2] |
||||
|
||||
[ext_resource path="res://utils/world_generation/WorldGeneration.gd" type="Script" id=1] |
||||
[ext_resource path="res://menu/LoadingScreen.gd" type="Script" id=1] |
||||
|
||||
[node name="WorldGeneration" type="Control"] |
||||
[node name="LoadingScreen" type="Control"] |
||||
anchor_right = 1.0 |
||||
anchor_bottom = 1.0 |
||||
script = ExtResource( 1 ) |
||||
Binary file not shown.
Loading…
Reference in new issue