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/Game.cs | |
| parent | a2d3673f1482c4366cdfff2b22e013c2d53fcc06 (diff) | |
HP alterado
Diffstat (limited to 'scripts/Game.cs')
| -rw-r--r-- | scripts/Game.cs | 4 |
1 files changed, 4 insertions, 0 deletions
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 { /// </summary> private InputHandler inputHandler; + private UI ui; + public override void _Ready() { base._Ready(); Map = GetNode<Map>("Map"); inputHandler = GetNode<InputHandler>("InputHandler"); + ui = GetNode<UI>("UI"); // O jogador é criado pelo jogo. Player player = new Player(Vector2I.Zero, null, playerDefinition); Camera2D camera = GetNode<Camera2D>("Camera2D"); RemoveChild(camera); + player.HealthChanged += (int hp, int maxHp) => ui.OnHealthChanged(hp, maxHp); player.AddChild(camera); |
