2023-11-08 14:28:55 +11:00
|
|
|
extends TextureRect
|
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
@export var segments: Array[LivesBarSegment]
|
|
|
|
var lives: float = 120.0
|
2023-11-08 14:28:55 +11:00
|
|
|
|
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
func take_life() -> void:
|
|
|
|
var segment_to_animate: int = ceil(lives / 6.0) - 1
|
2023-11-08 14:28:55 +11:00
|
|
|
lives -= 1
|
|
|
|
segments[segment_to_animate].take_life(1)
|