20 lines
464 B
GDScript
20 lines
464 B
GDScript
extends Label
|
|
|
|
|
|
# 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
|
|
func _ready():
|
|
visible = false
|
|
%tip.body_entered.connect(_on_body_entered)
|
|
|
|
func _on_body_entered(body: Node2D):
|
|
if body.has_method("take_damage"):
|
|
visible = true
|
|
await get_tree().create_timer(3.0).timeout
|
|
visible = false
|