summaryrefslogtreecommitdiff
path: root/scripts/UI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/UI.cs')
-rw-r--r--scripts/UI.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/UI.cs b/scripts/UI.cs
new file mode 100644
index 0000000..fada956
--- /dev/null
+++ b/scripts/UI.cs
@@ -0,0 +1,17 @@
+using Godot;
+using System;
+
+public partial class UI : Node2D
+{
+ private TextureProgressBar hpBar;
+
+ public override void _Ready() {
+ base._Ready();
+ hpBar = GetNode<TextureProgressBar>("CanvasLayer/HPbar");
+ }
+
+ public void OnHealthChanged(int hp, int maxHp) {
+ hpBar.Value = hp;
+ hpBar.MaxValue = maxHp;
+ }
+}