20 lines
454 B
GDScript
20 lines
454 B
GDScript
extends Area2D
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
# Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
signal hint_triggered
|
|
|
|
func _ready():
|
|
body_entered.connect(_on_body_entered)
|
|
add_to_group("hint")
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
if body.has_method("take_damage"): # 是主角
|
|
hint_triggered.emit()
|