diff --git a/scenes/debugger/Bolts.cs b/scenes/debugger/Bolts.cs new file mode 100644 index 0000000..205bc0d --- /dev/null +++ b/scenes/debugger/Bolts.cs @@ -0,0 +1,21 @@ +using Godot; +using System; + +public class Bolts : Label +{ + private Game _game; + private Event _event; + + public override void _Ready() + { + _game = GetNode("/root/Game"); + _event = GetNode("/root/Event"); + _event.Connect("BoltCollected", this, "OnBoltCollected"); + Text = "0"; + } + + public void OnBoltCollected(int bolts) + { + Text = _game.Bolts.ToString(); + } +} diff --git a/scenes/debugger/Debugger.tscn b/scenes/debugger/Debugger.tscn index 18142e7..de45e73 100644 --- a/scenes/debugger/Debugger.tscn +++ b/scenes/debugger/Debugger.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://scenes/debugger/StateDebugger.cs" type="Script" id=1] [ext_resource path="res://scenes/debugger/FPS.cs" type="Script" id=2] +[ext_resource path="res://scenes/debugger/Bolts.cs" type="Script" id=3] [node name="Debugger" type="CanvasLayer"] @@ -12,7 +13,7 @@ anchor_bottom = 1.0 [node name="VBoxContainer" type="VBoxContainer" parent="Control"] [node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer"] -margin_right = 40.0 +margin_right = 41.0 margin_bottom = 14.0 [node name="Label" type="Label" parent="Control/VBoxContainer/HBoxContainer"] @@ -28,7 +29,7 @@ script = ExtResource( 2 ) [node name="HBoxContainer2" type="HBoxContainer" parent="Control/VBoxContainer"] margin_top = 18.0 -margin_right = 40.0 +margin_right = 41.0 margin_bottom = 32.0 [node name="Label" type="Label" parent="Control/VBoxContainer/HBoxContainer2"] @@ -41,3 +42,19 @@ margin_left = 40.0 margin_right = 40.0 margin_bottom = 14.0 script = ExtResource( 1 ) + +[node name="HBoxContainer3" type="HBoxContainer" parent="Control/VBoxContainer"] +margin_top = 36.0 +margin_right = 41.0 +margin_bottom = 50.0 + +[node name="Label" type="Label" parent="Control/VBoxContainer/HBoxContainer3"] +margin_right = 37.0 +margin_bottom = 14.0 +text = "Bolts:" + +[node name="Label2" type="Label" parent="Control/VBoxContainer/HBoxContainer3"] +margin_left = 41.0 +margin_right = 41.0 +margin_bottom = 14.0 +script = ExtResource( 3 )