aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@xglobe.in>2020-05-01 13:33:27 +0200
committerOmar Polo <op@xglobe.in>2020-05-01 13:33:27 +0200
commit4456f1f647cd602c3cd94c685eb14f2e7738a645 (patch)
tree8aebf236f2cfe378750d478a14f00a0d9fe832fe
parent4184c7783480784129bb2300e0d71b909319b434 (diff)
downloaddungeon-generator-4456f1f647cd602c3cd94c685eb14f2e7738a645.tar.gz
dungeon-generator-4456f1f647cd602c3cd94c685eb14f2e7738a645.tar.bz2
don't generate the map if still runningHEADmaster
-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: