MarchGame/scripts/ui.gd

17 lines
602 B
GDScript3
Raw Permalink Normal View History

2026-04-14 00:36:19 +00:00
class_name UI extends Control
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/health
@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer2/timer
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer3/coiins
func _ready() -> void:
health.text = "Hi MOM!"
func updateTimer(timerValue)->void:
timer.text = str(timerValue)
func updateHealth(healthValue, maxHealth)->void:
health.text = str(healthValue)
func updateCoins(collectedCoins, coinsRemaining)->void:
coins.text= str(collectedCoins)+" of "+str(coinsRemaining+collectedCoins)