stamina and health bar
This commit is contained in:
parent
d17b16ad5b
commit
5b417b540b
9 changed files with 184 additions and 10 deletions
16
player/health_bar.gd
Normal file
16
player/health_bar.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
get_parent().modulate.a = 0.
|
||||
|
||||
func update(value: int) -> void:
|
||||
if value == 3: return
|
||||
get_parent().modulate.a = 1.
|
||||
|
||||
for child in get_children():
|
||||
child.visible = value > 0
|
||||
value -= 1
|
||||
|
||||
create_tween() \
|
||||
.tween_property(get_parent(), "modulate:a", 0., 1.) \
|
||||
.set_delay(2.)
|
||||
Loading…
Add table
Add a link
Reference in a new issue