This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues/pull-requests.
evospace/ui/hud/hud.gd

25 lines
670 B
GDScript
Raw Normal View History

2020-09-06 23:02:19 +03:00
extends Control
onready var score_label: Label = $layer/score_label
onready var bombs_label: Label = $layer/bombs_label
onready var lives_label: Label = $layer/lives_label
onready var timer_label: Label = $layer/timer_label
onready var timer: Timer = $layer/timer_label/round_timer
var player
func _ready():
player = get_parent().get_node("player")
update_labels()
func _process(delta):
timer_label.text = str("T: ", timer.time_left).pad_decimals(0)
func update_labels():
score_label.text = str("Score: ", player.score).pad_zeros(8)
lives_label.text = str(player.lives)
bombs_label.text = str(player.bombs)
func _on_round_timer_timeout():
player.kill(true)