extends Path2D

onready var follow = $takip

var dolu = false
var user

func _ready():
	follow.unit_offset = 0.8
	pass
func _process(delta):
#	print("Sureler:"+str(global.sureBittiler))
	if follow.get_child_count() > 0:
		dolu = true
		user = follow.get_child(0)
		if global.sureBittiler[name] and user.tuvaleteGitti:
			cikisaGit(delta)
		else:
			tuvaleteGit(delta)
	else:
		dolu = false
	pass
	
func tuvaleteGit(delta):
#	print("# TUVALETE GİDİYOR")
	follow.unit_offset = follow.unit_offset - user.speed * delta
	
func cikisaGit(delta):
#	print("# ÇIKIŞA GİDİYOR")
	follow.unit_offset = follow.unit_offset + user.speed * delta
	pass
