summaryrefslogtreecommitdiff
path: root/scripts/Game.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-11-04 18:14:43 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-11-04 18:14:43 -0300
commitd312f5a470c9f3cde27ed44492c13ae7d6bd2fe5 (patch)
tree61f46ae40eecf18c2c267d35406ff6f312337e06 /scripts/Game.cs
parent63e4f75e9292e1276cc0b5d11ebad010f147aa68 (diff)
Definir nome de jogador
Diffstat (limited to 'scripts/Game.cs')
-rw-r--r--scripts/Game.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/Game.cs b/scripts/Game.cs
index 47102c1..e55b937 100644
--- a/scripts/Game.cs
+++ b/scripts/Game.cs
@@ -46,7 +46,7 @@ public partial class Game : Node
SignalBus.Instance.EscapeRequested += escapeLambda;
}
- public void NewGame()
+ public void NewGame(string name)
{
map = GetNode<Map.Map>("Map");
@@ -55,6 +55,10 @@ public partial class Game : Node
// O jogador é criado pelo jogo.
Player player = new Player(Vector2I.Zero, null, playerDefinition);
+ if (name != "")
+ {
+ player.DisplayName = name;
+ }
Camera2D camera = GetNode<Camera2D>("Camera2D");
RemoveChild(camera);
player.HealthChanged += (int hp, int maxHp) => hud.OnHealthChanged(hp, maxHp);