mirror of
https://github.com/SEISYUNLie/Platform-Jump.git
synced 2026-10-23 17:31:11 +08:00
14 lines
343 B
GDScript
14 lines
343 B
GDScript
extends HBoxContainer
|
|
|
|
@export var full_texture: Texture2D
|
|
@export var empty_texture: Texture2D
|
|
@export var max_health: int = 5
|
|
|
|
func update_health(current_health: int):
|
|
for i in range(get_child_count()):
|
|
var icon = get_child(i) as TextureRect
|
|
if i < current_health:
|
|
icon.texture = full_texture
|
|
else:
|
|
icon.texture = empty_texture
|