Health bar adjustments

This commit is contained in:
2025-03-11 10:25:58 +01:00
parent 23ddace3fa
commit 43d5ee2b5f
4 changed files with 32 additions and 1 deletions

View File

@ -63,5 +63,12 @@ func set_character_data():
func adjust_health_bar() -> void:
var health_bar = get_node("ProgressBar")
health_bar.value = health / current_health * 100
if current_shield > 0:
health_bar.get("theme_override_styles/fill").bg_color = Color(0,0,1)
health_bar.get("theme_override_styles/background").bg_color = Color(0,1,0)
health_bar.value = shield / current_shield * 100
else:
health_bar.get("theme_override_styles/fill").bg_color = Color(0,1,0)
health_bar.get("theme_override_styles/background").bg_color = Color(1,0,0)
health_bar.value = health / current_health * 100
pass