extends Area2D
signal event(dict)

# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var event_type = ""
export var res = ""
var root_scene

# Called when the node enters the scene tree for the first time.
func _ready():
	root_scene = get_tree().get_root().get_child(0)
	if root_scene.has_method("event_triggered"):
		self.connect("event",root_scene,"event_triggered")
		
	pass # Replace with function body.




# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass


func _on_Event_Area_area_entered(area):
	var event = {"event_type": event_type, "info": res}
#	emit_signal("event")
	print("entro al area")
	root_scene.event_triggered(event)
#	print(get_tree().name)
#	print(get_tree().get_root().get_child(0).name)
	pass # Replace with function body.
