extends Node2D

@export var curve : BezierCurve

@export var color : Color = Color(1, 1, 1)
@export var segments : int = 100

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass

func _draw() -> void:
	if curve == null:
		return

	var prev : Vector3 = curve.eval(0);
	for i in range(1, segments + 1):
		var next = (curve.eval(float(i) / segments))

		draw_line(Vector2(prev.x, prev.y), Vector2(next.x, next.y), color, 2)
		prev = next
