Files
homework/scenes/notenough.gd
T
2026-10-07 19:35:15 +08:00

22 lines
531 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
var goal = get_tree().get_first_node_in_group("goal")
if goal:
goal.not_enough_coins.connect(_on_not_enough_coins)
func _on_not_enough_coins():
visible = true
text = "金币不够!"
await get_tree().create_timer(3.0).timeout # 等 3 秒
visible = false