Exemple #1
0
        private void bnt_Pronto_Click(object sender, RoutedEventArgs e)
        {
            if (player01.pontosVida <= 0 || player02.pontosVida <= 0)
            {
                player01.pontosVida = life01;
                player02.pontosVida = life02;
            }

            janelaCombateObj = new JanelaCombate();
            janelaCombateObj.Show();
            janelaCombateObj.image_char01Combate.Source = new BitmapImage(new Uri("D:/zzProjects/C#/Visual Studio/DejotaGame/DejotaGame/img/" + avatarEscolhidoPlayer01 + ".jpg"));
            janelaCombateObj.image_char02Combate.Source = new BitmapImage(new Uri("D:/zzProjects/C#/Visual Studio/DejotaGame/DejotaGame/img/" + avatarEscolhidoPlayer02 + ".jpg"));

            if (textBox_nomeJogador1.Text != "")
            {
                janelaCombateObj.lbl_NomeJogador01Combate.Content = textBox_nomeJogador1.Text;
                player01.nomeJogador = textBox_nomeJogador1.Text;
            }
            else
            {
                player01.nomeJogador = "Noob01";
            }

            if (textBox_nomeJogador2.Text != "")
            {
                janelaCombateObj.lbl_NomeJogador02Combate.Content = textBox_nomeJogador2.Text;
                player02.nomeJogador = textBox_nomeJogador2.Text;
            }
            else
            {
                player02.nomeJogador = "Noob02";
            }

            janelaCombateObj.lbl_vidaJogador01Combate.Content = player01.pontosVida.ToString();
            janelaCombateObj.lbl_vidaJogador02Combate.Content = player02.pontosVida.ToString();

            Thread t01 = new Thread(new ThreadStart(fight01));
            Thread t02 = new Thread(new ThreadStart(fight02));

            t01.Start();
            t02.Start();
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.JanelaDeCombate = ((DejotaGame.JanelaCombate)(target));

            #line 8 "..\..\JanelaCombate.xaml"
                this.JanelaDeCombate.Closing += new System.ComponentModel.CancelEventHandler(this.JanelaDeCombate_Closing);

            #line default
            #line hidden

            #line 8 "..\..\JanelaCombate.xaml"
                this.JanelaDeCombate.Closed += new System.EventHandler(this.JanelaDeCombate_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.image_char01Combate = ((System.Windows.Controls.Image)(target));
                return;

            case 3:
                this.image_char02Combate = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.lbl_fight = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.lbl_vidaJogador01Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.lbl_NomeJogador01Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.lbl_NomeJogador02Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.lbl_danoJogador01Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.lbl_danoJogador02Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.lbl_vidaJogador02Combate = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.listBox_combateLog = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }