diff options
| author | GustavoEklund <eklundgu@gmail.com> | 2025-08-28 20:38:10 -0300 |
|---|---|---|
| committer | GustavoEklund <eklundgu@gmail.com> | 2025-08-28 20:38:10 -0300 |
| commit | 5f23459b25f9232847e2c9b33b3171937c536fd6 (patch) | |
| tree | 16926b62e80a1d0a9ec08ca8e57398faef76f26f /scripts/Game.cs | |
| parent | f55c5e899a073cc0033fdbdde04a2de4644433fb (diff) | |
| parent | 3c9192b24c09146df066fd986f34d269c50648e8 (diff) | |
Merge branch 'master' of https://github.com/Simplesmente-O-Grupo/projeto-fantasia
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); |
