IcicleDetection.gd 332 B

123456789101112131415
  1. class_name IcicleDetection
  2. extends Node
  3. @export var hitbox: Area2D = null
  4. signal icicle_detected(icicle: Icicle)
  5. func _ready() -> void:
  6. if hitbox != null:
  7. hitbox.area_entered.connect(area_entered)
  8. func area_entered(area: Area2D) -> void:
  9. if area.owner is Icicle:
  10. if area.owner.falling:
  11. icicle_detected.emit(area.owner)