Crystalline-awakening/player/smallPlayer/menus/progress_bar.gd

14 lines
357 B
GDScript3
Raw Normal View History

2025-05-18 14:16:22 +00:00
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