From 3c9192b24c09146df066fd986f34d269c50648e8 Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 28 Aug 2025 20:34:00 -0300 Subject: HP alterado --- scripts/UI.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/UI.cs (limited to 'scripts/UI.cs') 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("CanvasLayer/HPbar"); + } + + public void OnHealthChanged(int hp, int maxHp) { + hpBar.Value = hp; + hpBar.MaxValue = maxHp; + } +} -- cgit v1.2.3