NovemberGodotGame/novembergame/scripts/ui.gd

20 lines
660 B
GDScript

extends Control
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/health
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer2/coins
@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer3/timer
var tempCoinCount = 0
var tempCoinTotal = 0
func timerUpdate(amt):
timer.text = "Seconds : "+str(amt)
func healthUpdate(amt):
health.text=("Health : "+str(amt) )
func coinsUpdate(amt, total):
tempCoinCount = amt
tempCoinTotal = total
if coins:
coins.text = ("Coins : "+str(amt)+" of "+str(total) )
func _ready() -> void:
coins.text = ("Coins : "+str(tempCoinCount)+" of "+str(tempCoinTotal) )