extends AnimatedSprite2D

var mover: Boss;
@export var shadow: Sprite2D;

func _ready() -> void:
	play("idle");
	mover = get_parent().get_parent() as Boss;

func _process(_delta: float) -> void:
	var direction: Vector2 = mover.sprite_direction;
	direction = direction.normalized();
	if (direction.length() < 0.01):
		play("idle");
	elif abs(direction.x) > abs(direction.y):
		flip_h = direction.x < 0;
		shadow.flip_h = direction.x < 0;
		play("walk_h");
	elif (direction.y > 0.0):
		play("walk_b");
	else:
		play("walk_t");
