1
Fork 0
mirror of https://github.com/Cookie-CHR/LD54-SPAce-ltd.git synced 2024-11-25 00:34:18 +00:00
space-ltd/Components/gather_info.gd

25 lines
594 B
GDScript3
Raw Normal View History

extends Node2D
signal game_success
signal game_fail
var base_scn = preload("res://Components/gameplay.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
var level = self.name
var base = base_scn.instantiate()
base.planets = Diction.planets_lvl[level]
base.map = Diction.map_lvl[level]
base.connect("game_success", forward.bind("success"))
base.connect("game_fail", forward.bind("fail"))
add_child(base)
$Label.text = Diction.label_lvl[level]
func forward(x):
if (x=="success"):
emit_signal("game_success")
else:
emit_signal("game_fail")