From 3c9192b24c09146df066fd986f34d269c50648e8 Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 28 Aug 2025 20:34:00 -0300 Subject: HP alterado --- scripts/Game.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/Game.cs') diff --git a/scripts/Game.cs b/scripts/Game.cs index ab4bd8e..4dc7a34 100644 --- a/scripts/Game.cs +++ b/scripts/Game.cs @@ -19,17 +19,21 @@ public partial class Game : Node { /// private InputHandler inputHandler; + private UI ui; + public override void _Ready() { base._Ready(); Map = GetNode("Map"); inputHandler = GetNode("InputHandler"); + ui = GetNode("UI"); // O jogador é criado pelo jogo. Player player = new Player(Vector2I.Zero, null, playerDefinition); Camera2D camera = GetNode("Camera2D"); RemoveChild(camera); + player.HealthChanged += (int hp, int maxHp) => ui.OnHealthChanged(hp, maxHp); player.AddChild(camera); -- cgit v1.2.3