extends Node
class_name MovementComponent

signal MovementInput(movement_vector: Vector2)

# Dynamic Exports
@export var body: CharacterBody2D

var movement_vector: Vector2

func _physics_process(_delta: float) -> void:
	var direction_vector := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
	
	if direction_vector:
		movement_vector = direction_vector
		MovementInput.emit(movement_vector)
	else:
		movement_vector = Vector2.ZERO
