Exemple #1
0
        public void StartGameMultiplayer()
        {
            Global.UnfocusAllTextBox();
            gameMode         = GameMode.Multiplayer;
            CurrentGameState = GameState.Started;
            if (hexMap == null)
            {
                string[] textures = new string[3];
                textures[0] = "Hexa";
                textures[1] = "hexa_near";
                textures[2] = "hexa_far";
                hexMap      = new HexagonMap((int)(375.0f * ScreenScaleFactor.X), (int)(110.0f * ScreenScaleFactor.Y), 9, 45, 26, textures);
            }

            var username = TextBoxName.GetText();
            var roomid   = TextBoxRoom.GetText();

            if (ServerReady)
            {
                HexagonServer.Emit("register", username + "|" + roomid);
            }

            hexMap.StartMultiplayer();
        }