# HUD.gd # Verwaltet die Spieler-UI: HP-Leiste, Aktionsleiste (Slots 1-9) extends CanvasLayer @onready var health_bar = $Control/HealthBar @onready var health_label = $Control/HealthBar/HealthLabel @onready var action_slots = [ $Control/ActionBar/A1, $Control/ActionBar/A2, $Control/ActionBar/A3, $Control/ActionBar/A4, $Control/ActionBar/A5, $Control/ActionBar/A6, $Control/ActionBar/A7, $Control/ActionBar/A8, $Control/ActionBar/A9 ] var active_slot = 0 # HP-Leiste und Text aktualisieren func update_health(current_hp, max_hp): health_bar.max_value = max_hp health_bar.value = current_hp health_label.text = str(current_hp) + " / " + str(max_hp) # Aktions-Slot kurz golden hervorheben (0.1s) func set_active_slot(index): action_slots[active_slot].self_modulate = Color(1, 1, 1) active_slot = index action_slots[active_slot].self_modulate = Color(1, 0.8, 0) await get_tree().create_timer(0.1).timeout action_slots[active_slot].self_modulate = Color(1, 1, 1)