Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

30 linhas
629 B

  1. extends Node
  2. export var scenes : Dictionary
  3. signal end
  4. func _ready():
  5. load_scene("TestLVL")
  6. func load_scene(scene_key):
  7. yield(get_tree(),"idle_frame")
  8. print(scene_key)
  9. if scenes.has(scene_key):
  10. for child in $SceneContainer.get_children():
  11. child.queue_free()
  12. var scene = scenes[scene_key].instance()
  13. scene.connect("request_new_scene", self, "load_scene")
  14. $SceneContainer.add_child(scene)
  15. if scene_key == "TestGameOver":
  16. $CanvasLayer/UI.hide()
  17. else:
  18. $CanvasLayer/UI.show()
  19. func wait_signal(args):
  20. yield(self, "end")
  21. func _input(event):
  22. if event.is_action_pressed("ui_cancel"):
  23. emit_signal("end")