MarchTTLGame/scripts/ui.gd

17 lines
597 B
GDScript3
Raw Permalink Normal View History

2026-04-14 00:36:57 +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/Coins
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, coinsRemaning)->void:
coins.text=str(collectedCoins)+" of "+str(coinsRemaning+collectedCoins)