瀏覽代碼

Cache l'ecran titre quand un niveau est lance

DricomDragon 1 年之前
父節點
當前提交
82f530ce1a
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      godot/exec/choix/choix.gd

+ 5 - 2
godot/exec/choix/choix.gd

@@ -1,6 +1,9 @@
 extends Node2D
 
 
+@onready var monde: Node = get_parent()
+
+
 func _ready() -> void:
 	for child in get_children():
 		assert(child is Planete, "Seules les planetes sont autorisees dans le systeme")
@@ -9,5 +12,5 @@ func _ready() -> void:
 
 
 func demarrer_niveau(niveau: PackedScene) -> void:
-	add_sibling(niveau.instantiate())
-	queue_free()
+	monde.add_sibling(niveau.instantiate())
+	monde.queue_free()