Crystalline-awakening/player/smallPlayer/menus/progress_bar.gd
2025-05-18 16:16:22 +02:00

14 lines
357 B
GDScript

extends ProgressBar
func _ready() -> void:
await get_tree().process_frame
var crystals = get_tree().get_nodes_in_group("crystals")
print("Got " + str(crystals.size()) + " crystals")
for crystal in crystals:
print("Connecting crystal: " + crystal.name)
crystal.connect("crystal_picked_up", Callable(self, "collect"))
func collect():
value += 2.0