private void startGame() { GameForm gameForm; if (lobbyClient == null) { lobbyServer.terminateConnection(); gameForm = new GameForm(playerName, connectedPort); } else { lobbyClient.terminateConnection(); gameForm = new GameForm(playerName, connectedIP, connectedPort); } gameForm.FormClosed += (s, args) => Close(); gameForm.Show(); Hide(); timer.Stop(); }