第一次提交作业
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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():
|
||||
var player = %Player
|
||||
if player:
|
||||
player.coin_changed.connect(_on_coin_changed)
|
||||
_on_coin_changed(player.coins) # 初始化显示
|
||||
print("信号已连接")
|
||||
|
||||
func _on_coin_changed(total: int):
|
||||
text = "金币: %d/12" % total
|
||||
Reference in New Issue
Block a user