From bed68922a9299a5fca652c0c51f133e7ce00a7dc Mon Sep 17 00:00:00 2001 From: rawer470 Date: Tue, 20 Aug 2024 01:03:01 +0300 Subject: [PATCH] StartMultiplayerGame --- ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs | 2 ++ ZoFo/GameCore/Server.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs index d500c49..c7d8c35 100644 --- a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs +++ b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs @@ -53,6 +53,8 @@ public class WaitingForPlayersGUI : AbstractGUI { // start AppManager.Instance.ChangeState(GameState.HostPlaying); + AppManager.Instance.SetGUI(new HUD()); + AppManager.Instance.server.StartGame(); // ваш код здесь }; Elements.Add(startButton); diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 2abf5dd..c9ebf6e 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -140,7 +140,7 @@ namespace ZoFo.GameCore networkManager.AddData(gameEnded); } - public List gameObjects; + public List gameObjects = new List(); public List entities; //entity public List players; public void Update(GameTime gameTime)