diff options
Diffstat (limited to 'scripts/GUI/Hud.cs')
| -rw-r--r-- | scripts/GUI/Hud.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/GUI/Hud.cs b/scripts/GUI/Hud.cs new file mode 100644 index 0000000..5f49121 --- /dev/null +++ b/scripts/GUI/Hud.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class Hud : Node +{ + private TextureProgressBar hpBar; + + public override void _Ready() { + base._Ready(); + hpBar = GetNode<TextureProgressBar>("InfoBar/Stats/MarginContainer/HBoxContainer/HPbar"); + } + + public void OnHealthChanged(int hp, int maxHp) { + hpBar.Value = hp; + hpBar.MaxValue = maxHp; + } +} |
