Boot screen

This commit is contained in:
2024-08-09 14:14:51 +08:00
parent 34100ee727
commit 40b0f2e176
7 changed files with 126 additions and 24 deletions

View File

@ -27,6 +27,15 @@ public partial class World : Node2D
AddChild(_roundTimer);
_roundTimer.Start();
// Add players into the game
PutPlayers(currentPlayerName);
}
public override void _Ready()
{
if (!Multiplayer.IsServer())
return;
// Handling player connect / disconnect after this client connected
Multiplayer.PeerDisconnected += RemovePlayer_Adaptor;
Multiplayer.PeerConnected += AddPlayer_Adaptor;
@ -37,10 +46,7 @@ public partial class World : Node2D
// Add this client as a player if client isn't a dedicated server
if (!OS.HasFeature("dedicated_server"))
Scoreboard.AddPlayer(1, currentPlayerName);
// Add players into the game
PutPlayers(currentPlayerName);
Scoreboard.AddPlayer(1);
}
public override void _ExitTree()