Fixed last push

This commit is contained in:
theskywinds 2025-05-18 16:16:22 +02:00
parent 879a4279a5
commit 26532f0755
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://cnvs3iophpe3n"]
[ext_resource type="Script" uid="uid://biv656fho5bpy" path="res://player/smallPlayer/menus/progress_bar.gd" id="1_qy0dt"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="ProgressBar" type="ProgressBar" parent="CanvasLayer"]
offset_right = 367.0
offset_bottom = 27.0
script = ExtResource("1_qy0dt")

View File

@ -0,0 +1,13 @@
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

View File

@ -0,0 +1 @@
uid://biv656fho5bpy