private void Form1_Load(object sender, EventArgs e) { startButton.Location = new Point(200, 200); startButton.Size = new Size(150, 70); startButton.Text = "Start Local"; Initialise.SetVisibilityEnable(ref startButton, true); socketButton.Location = new Point(200, 300); socketButton.Size = new Size(150, 70); socketButton.Text = "Start Online"; Initialise.SetVisibilityEnable(ref socketButton, true); loadButton.Location = new Point(200, 400); loadButton.Size = new Size(150, 50); loadButton.Text = "Load"; Initialise.SetVisibilityEnable(ref loadButton, false); tank1timer.Enabled = false; tank2timer.Enabled = false; exit.Location = new Point(200, 450); exit.Size = new Size(150, 50); exit.Text = "Exit"; Initialise.SetVisibilityEnable(ref exit, true); tank1Pic.Location = new Point(250, 400); tank2Pic.Location = new Point(250, 56); }
private void loadButton_Click(object sender, EventArgs e) { Initialise.SetVisibilityEnable(ref startButton, false); Initialise.SetVisibilityEnable(ref loadButton, false); Initialise.SetVisibilityEnable(ref socketButton, false); LoadGame(new Point(2, 2), new Point(452, 452)); }
private void socketButton_Click(object sender, EventArgs e) { Initialise.SetVisibilityEnable(ref startButton, false); Initialise.SetVisibilityEnable(ref loadButton, false); Initialise.SetVisibilityEnable(ref socketButton, false); Initialise.SetVisibilityEnable(ref exit, false); buttonClient.Text = "Odpal Client'a"; buttonHost.Text = "Odpal Host'a"; Initialise.SetVisibilityEnable(ref buttonHost, true); Initialise.SetVisibilityEnable(ref buttonClient, true); online = true; ipLabel.Text = "Twoj DNS: " + SocketConnect.serverIp; //iphost.MapToIPv4().ToString() + ipLabel.Location = new Point(200, 100); ipLabel.Size = new Size(200, 50); ipLabel.Enabled = true; ipLabel.Visible = true; this.Controls.Add(ipLabel); secondIP.Location = new Point(200, 150); ipLabel.Size = new Size(200, 50); secondIP.Text = "Wprowadz DNS"; secondIP.Enabled = true; secondIP.Visible = true; this.Controls.Add(secondIP); }
private void buttonClient_Click(object sender, EventArgs e) { SocketConnect.HostClientStart(8181, 8080, false); Initialise.SetVisibilityEnable(ref buttonHost, false); Initialise.SetVisibilityEnable(ref buttonClient, false); startButton.Text = "Start gdy gracze gotowi"; Initialise.SetVisibilityEnable(ref startButton, true); }
private void LoadGame(Point tank1p, Point tank2p) { Button load1 = new Button(); Initialise.SetVisibilityEnable(ref load1, true); load1.Location = new Point(200, 200); load1.Size = new Size(100, 100); tank1Pic.Location = tank1p; tank2Pic.Location = tank2p; StartGame(); }
private void startButton_Click(object sender, EventArgs e) { Initialise.SetVisibilityEnable(ref startButton, false); Initialise.SetVisibilityEnable(ref loadButton, false); Initialise.SetVisibilityEnable(ref socketButton, false); Initialise.SetVisibilityEnable(ref exit, false); if (online == true) { timerHost.Enabled = true; timerSend.Enabled = true; } disconect = false; StartGame(); }
private void StartGame() { panel1.Location = new Point(0, 0); panel1.Size = new Size(500, 500); panel1.BackColor = Color.FromArgb(111, 99, 91); this.Controls.Add(panel1); Initialise.GenerateMap(ref panel1, ref listWall, ref listSwamp); Bitmap background = new Bitmap(panel1.Width, panel1.Height); panel1.DrawToBitmap(background, panel1.DisplayRectangle); panel1.BackgroundImage = background; Initialise.CreateTanks(ref tank1, ref tank2, ref tank1Pic, ref tank2Pic, ref tank1timer, ref tank2timer); Controls.Add(Form1.lifeT1); Controls.Add(Form1.lifeT2); tank1timer.Enabled = true; tank2timer.Enabled = true; }