9 lines
244 B
GDScript
9 lines
244 B
GDScript
extends TextureRect
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
EventBus.health_changed.connect(_on_health_changed)
|
|
|
|
func _on_health_changed(new : int):
|
|
texture.region = Rect2(0, new * 32, 0, 32)
|