game-ui-patterns
Installation
SKILL.md
Game UI Patterns
HUD Health Bar
# Health bar with smooth tween animation and damage flash
class_name HealthBar extends Control
@onready var fill_bar: ProgressBar = $FillBar
@onready var ghost_bar: ProgressBar = $GhostBar # Lags behind for damage visualization
@onready var flash_overlay: ColorRect = $FlashOverlay
@export var ghost_tween_duration: float = 0.4
@export var flash_duration: float = 0.1
var _ghost_tween: Tween
func _ready() -> void:
flash_overlay.modulate.a = 0.0