nc5432 69008d0046 More animations
- Implemented firebolt animation
- Started on icy wind animation
- Added animation to health bars
- Improved the animation system more
- Cleaned up some code
2024-05-14 21:40:18 -04:00

14 lines
347 B
GDScript

class_name HealthBar extends Control
@onready var bar: ColorRect = $ColorRect2
@export var maxHealth: float = 1
var barSize: Vector2 = Vector2(20, 100)
var tween: Tween
func healthChanged(health) -> void:
if (tween): tween.kill()
tween = create_tween()
barSize.y = (health / maxHealth) * 100
tween.tween_property(bar, "size", barSize, 0.3)