extends VBoxContainer

func _physics_process(delta):
	var dad = get_node("../../..")
	if dad.usernamelist.has(int(name)):
		$username.text = dad.usernamelist[int(name)]

func _update(arg):
#	if arg.has('name'):
#		$username.text = arg.name
	if arg.has('k'):
		$enemieskilled.text = 'enemies killed: ' + str(arg.k)
	if arg.has('hp'):
		$hp/health.value = arg.hp
		$hp.text = str(arg.hp)
	if arg.has('xp'):
		$xp/xp.value = arg.xp
		$xp.text = str(arg.xp)
	if arg.has('lv'):
		$lv.text = 'level: : '+str(arg.lv)
	if arg.has('nxt'):
		$xp/xp.max_value = arg.nxt
	if arg.has('maxhp'):
		$hp/health.max_value = arg.maxhp
