
- Implemented firebolt animation - Started on icy wind animation - Added animation to health bars - Improved the animation system more - Cleaned up some code
14 lines
347 B
GDScript
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)
|