necra-prototypes/guideline_point.gd

18 lines
400 B
GDScript

class_name GuidelinePoint
extends Sprite2D
@export_node_path("Node2D") var connections: Array[NodePath] = []
@onready var area = $Area2D
var scalpel: Scalpel
func _ready():
area.connect("area_exited", _on_area_entered)
scalpel = get_tree().get_first_node_in_group("cutter")
func _on_area_entered(area: Area2D):
if area != scalpel.cut_area or not scalpel.is_cutting: return
queue_free()