13 lines
339 B
GDScript
13 lines
339 B
GDScript
extends Control
|
|
|
|
onready var healthBar = $HealthBar
|
|
onready var updateTween = $UpdateTween
|
|
|
|
func healthUpdated(health):
|
|
healthBar.value = health
|
|
updateTween.interpolate_property(healthBar, "value", health, 0.2, Tween.TRANS_SINE, Tween.EASE_IN_OUT)
|
|
updateTween.start()
|
|
|
|
func maxHealthUpdated(maxHealth):
|
|
healthBar.max_value = maxHealth
|