2026-03-10 01:05:12 +00:00
|
|
|
class_name trigger extends Area2D
|
2026-03-09 21:11:08 +00:00
|
|
|
|
2026-03-10 01:05:12 +00:00
|
|
|
signal AreaTrigger(body, effect, trigger)
|
2026-03-09 21:11:08 +00:00
|
|
|
@export var effect="destroy"
|
|
|
|
|
|
|
|
|
|
# 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 _on_body_entered(body: Node2D) -> void:
|
|
|
|
|
print("Trigger activated")
|
2026-03-10 01:05:12 +00:00
|
|
|
AreaTrigger.emit(body, effect, self)
|