diff options
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); |
