Exemple #1
0
        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);
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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();
        }
Exemple #6
0
 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();
 }