Esempio n. 1
0
        public void CambiarProgreso(int T)
        {
            if (this.InvokeRequired)
            {
                delegado2 del        = new delegado2(CambiarProgreso);
                object[]  parametros = new object[] { T };
                this.Invoke(del, parametros);
            }
            // posiciones y secuencia
            // contador
            else
            {
                if (count == 0)
                {
                    pb1.Image    = imageList1.Images[0];
                    pb1.Location = new Point(recorrer = recorrer + 20, pb1.Location.Y);

                    count++;
                }

                else if (count == 1)
                {
                    pb1.Image    = imageList1.Images[1];
                    pb1.Location = new Point(recorrer = recorrer + 20, pb1.Location.Y);

                    count++;
                }

                else if (count == 2)
                {
                    pb1.Image    = imageList1.Images[2];
                    pb1.Location = new Point(recorrer = recorrer + 20, pb1.Location.Y);

                    count++;
                }

                else if (count == 3)
                {
                    pb1.Image    = imageList1.Images[3];
                    pb1.Location = new Point(recorrer = recorrer + 20, pb1.Location.Y);

                    count = 0;
                }

                if (recorrer > 460)
                {
                    recorrer = -80;
                }

                lblTiempo.Text   = "Tiempo : " + T;
                pbProgreso.Value = T; // termina el hilo
            }
        }
Esempio n. 2
0
 public void CambiarProgreso(int T)
 {
     if (this.InvokeRequired)
     {
         delegado2 del        = new delegado2(CambiarProgreso);
         object[]  parametros = new object[] { T };
         this.Invoke(del, parametros);
     }
     // posiciones y secuencia
     // contador
     else
     {
         lblTiempo.Text   = "Tiempo : " + T;
         pbProgreso.Value = T; // termina el hilo
     }
 }
Esempio n. 3
0
        public void CambiarProgreso(int T)
        {
            if (this.InvokeRequired)
            {
                delegado2 del        = new delegado2(CambiarProgreso);
                object[]  parametros = new object[] { T };
                Invoke(del, parametros);
            }
            else
            {
                if (count == 0)
                {
                    bowser.Image = imgListBw.Images[0];
                    mario.Image  = imgListMb.Images[0];
                    count++;
                }

                else if (count == 1)
                {
                    bowser.Image = imgListBw.Images[1];
                    mario.Image  = imgListMb.Images[1];
                    count        = 0;
                }

                if (bowser.Location.X == mario.Location.X && bowser.Location.Y == mario.Location.Y)
                {
                    vidas -= 1;

                    if (vidas == 2)
                    {
                        vida3.Visible = false;
                        heart.Play();
                    }

                    if (vidas == 1)
                    {
                        vida2.Visible = false;
                        heart.Play();
                    }

                    if (vidas == 0)
                    {
                        vida3.Visible = false;
                        music.Stop();
                        gameover.Play();
                        MessageBox.Show("You Win!!!");
                        mario.Location    = new Point(40, 480);
                        bowser.Location   = new Point(660, 480);
                        tunel.Visible     = false;
                        lbltiempo.Visible = false;
                    }
                }

                if (mario.Location.X == tunel.Location.X && mario.Location.Y == tunel.Location.Y)
                {
                    music.Stop();
                    winner.Play();
                    MessageBox.Show("You Lose!!!");
                    mario.Location    = new Point(40, 480);
                    bowser.Location   = new Point(660, 480);
                    tunel.Visible     = false;
                    lbltiempo.Visible = false;
                }

                lbltiempo.Text = "Tiempo : " + T;
            }
        }