diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-28 20:34:00 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-28 20:34:00 -0300 |
| commit | 3c9192b24c09146df066fd986f34d269c50648e8 (patch) | |
| tree | 16a87abf3693bd9fac60997866315053c320363d /scripts/UI.cs | |
| parent | a2d3673f1482c4366cdfff2b22e013c2d53fcc06 (diff) | |
HP alterado
Diffstat (limited to 'scripts/UI.cs')
| -rw-r--r-- | scripts/UI.cs | 17 |
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; + } +} |
