extends CanvasLayer

var health_bob = 0
var health_bob_up = true


func _ready():
	$TextureProgress.max_value = stats.max_health
	$TextureProgress.value = stats.get_health()
	
func _process(_delta):
	$TextureProgress.value = stats.get_health()


func _on_BobTimer_timeout():
	if health_bob_up:
		health_bob += 1
		$TextureProgress.rect_position.y += 1
	else:
		health_bob -= 1
		$TextureProgress.rect_position.y -= 1
	
	if health_bob > 1:
		health_bob = 1
		health_bob_up = false
		
	if health_bob < -1:
		health_bob = -1
		health_bob_up = true
		
	
