summaryrefslogtreecommitdiff
path: root/hud.gd
blob: 0efc33a2479d27a1052a25d801cd6483abc9aa54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extends CanvasLayer


func _ready() -> void:
	%Score.text = str(Game.score)
	%Life.text = str(Game.player_state.life).pad_zeros(2)
	
	Game.score_changed.connect(func():
		%Score.text = str(Game.score)
	)
	
	Game.boss_initialized.connect(func(hp):
		%BossHPBar.visible = true
		%BossHPBar.initialize(hp)
		
		$PanelContainer/VBoxContainer/Top/Left/Score.visible = false
		$PanelContainer/VBoxContainer/Top/Left/Boss.visible = true
	)