public void MouseClicked(int x, int y, ref GameType gameType) { mouseClick = new Rectangle(x, y, 10, 10); if (mouseClick.Intersects(Bouton_host)) { c = new Client(); Thread t = new Thread(new ThreadStart(Program2.Mainq)); t.Start(); t.IsBackground = true; } if (mouseClick.Intersects(Bouton_Exit)) { Game1.GetGame().Exit(); } else if (mouseClick.Intersects(Bouton_Options)) { gameType = GameType.Menu_Option_Type; } else if (mouseClick.Intersects(Bouton_Multi)) { gameType = GameType.Menu_Play_Multi_Type2; } else if (mouseClick.Intersects(Bouton_Play)) { gameType = GameType.Menu_Play_Type; } else if (mouseClick.Intersects(Bouton_Solo)) { gameType = GameType.Menu_Play_Solo_Type; } }
public static void Mainq() { Client client = new Client(); while (!client.Connected) { Console.Write("Server IP Adress : "); string ip = Console.ReadLine(); Console.Write("Port : "); int port = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter your name : "); client.Connect(ip, port, Console.ReadLine()); Console.WriteLine(); } client.Run(); }