JanuaryGame/GodotProject/scripts/ui.gd

22 lines
706 B
GDScript

extends Control
@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer3/timer
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/health
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer2/coins
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func timerUpdate(timeRemaining):
timer.text=str(timeRemaining)
func healthUpdate(_healthRemaining):
health.text="HEALTH "+str(_healthRemaining)
func healthGone():
health.text="HEALTH 0"
func coinsUpdate(coinsCollectedTotal, coinsAvailableTotal):
coins.text=str(coinsCollectedTotal)+" of "+str(coinsAvailableTotal)