GodotGameWorkshop/ui.gd

19 lines
623 B
GDScript3
Raw Permalink Normal View History

extends Control
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/Health
@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer3/Timer
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer2/Coins
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
func healthUpdate(healthRemaining):
health.text = "Health: "+str(healthRemaining)
func timerUpdate(timeRemaining):
timer.text = str(timeRemaining)
func coinsUpdate(coinsRemaining, startingCoins):
coins.text = "Coins: "+str(coinsRemaining)+"/"+str(startingCoins)