extends Node

export(PackedScene) var Lifebar


func _ready():
	for actor in get_tree().get_nodes_in_group("actor"):
		create_lifebar(actor)
	# no spawners yet
	#for spawner in get_tree().get_nodes_in_group("spawner"): 
	#	spawner.connect("")


func create_lifebar(actor):
	if not (actor.has_node("Health") and actor.has_node("InterfaceHook")):
		return
	var lifebar = Lifebar.instance()
	add_child(lifebar)
	lifebar.initialize(actor)
