summaryrefslogtreecommitdiff
path: root/UI
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-10-02 19:23:19 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-10-02 19:23:19 +0200
commitc8bd14d6feeca72fc96b895c9382ebc16a1caf55 (patch)
tree8423bdead9ce57d3dd62759cf362073ac5955eb3 /UI
initial commit
Diffstat (limited to 'UI')
-rw-r--r--UI/HUD.tscn13
-rw-r--r--UI/hud.gd7
2 files changed, 20 insertions, 0 deletions
diff --git a/UI/HUD.tscn b/UI/HUD.tscn
new file mode 100644
index 0000000..5d4ac5b
--- /dev/null
+++ b/UI/HUD.tscn
@@ -0,0 +1,13 @@
+[gd_scene load_steps=2 format=3 uid="uid://d0mlxe0gcctle"]
+
+[ext_resource type="Script" path="res://UI/hud.gd" id="1_rpghv"]
+
+[node name="HUD" type="CanvasLayer"]
+script = ExtResource("1_rpghv")
+
+[node name="Score" type="Label" parent="."]
+unique_name_in_owner = true
+offset_left = 4.0
+offset_right = 14.0
+offset_bottom = 23.0
+text = "0"
diff --git a/UI/hud.gd b/UI/hud.gd
new file mode 100644
index 0000000..d5f7cc3
--- /dev/null
+++ b/UI/hud.gd
@@ -0,0 +1,7 @@
+extends CanvasLayer
+
+
+func _ready() -> void:
+ Game.score_changed.connect(func():
+ %Score.text = str(Game.score)
+ )