aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--World.gd10
1 files changed, 8 insertions, 2 deletions
diff --git a/World.gd b/World.gd
index a64b0bc..000b402 100644
--- a/World.gd
+++ b/World.gd
@@ -13,6 +13,9 @@ onready var _tilemap : TileMap = $TileMap
onready var _label : Label = $Progress
+var _running := false
+
+
func _ready() -> void:
pass
@@ -23,8 +26,11 @@ func _process(delta: float) -> void:
func _on_Button_pressed() -> void:
- _tilemap.clear()
- _generate_map()
+ if not _running:
+ _running = true
+ _tilemap.clear()
+ yield(_generate_map(), "completed")
+ _running = false
func _new_map() -> Array: