Ejemplo n.º 1
0
        private void cmdMundoDIVyMOD_Click(object sender, EventArgs e)
        { // se dirige al mundo de DIv y MOD
            Niveles_DIV_MOD llamarMuDIVyMOD = new Niveles_DIV_MOD();

            this.Hide();
            llamarMuDIVyMOD.ShowDialog();
            this.Show();
        }
Ejemplo n.º 2
0
        private void timerN5DyM_Tick(object sender, EventArgs e)
        {
            int punteminDyM2_5 = 70000, limiinfeDyM1_5 = 0, limeinfeDyM2_5 = 0, ADyM2_5 = 0, limiinfeDyM3_5 = 0, limesupeDyM1_5 = 0, limesupeDyM2_5 = 0, limisupeDyM3_5 = 0;

            ADyM2_5 = (punteomax5DIVyMOD - punteminDyM2_5) / 3;  // obtengo A, variable con la cual hare que todo lo demas funcione
            //obtengo los limites inferiores
            limiinfeDyM1_5 = punteminDyM2_5;
            limeinfeDyM2_5 = punteminDyM2_5 + ADyM2_5;
            limiinfeDyM3_5 = punteminDyM2_5 + (2 * ADyM2_5);
            //obtengo los limites superiores
            limesupeDyM1_5 = (punteminDyM2_5 + ADyM2_5) - 1;
            limesupeDyM2_5 = ((punteminDyM2_5 + (2 * ADyM2_5)) - 1);
            limisupeDyM3_5 = punteomax5DIVyMOD;

            //condiciono los intervalos entre del limite inferior y el limite superior
            if ((Convert.ToInt32(lblpunteoN5DyM.Text) >= limiinfeDyM1_5) && (Convert.ToInt32(lblpunteoN5DyM.Text) <= limesupeDyM1_5))
            {
                picbN5DyM.Image = imgliDIVyMOD.Images[1]; // si se cumple la condicion anterior obtendra 1 estrella
            }
            else
            {
                picbN5DyM.Image = imgliDIVyMOD.Images[0]; // si no se cumple, por ser la ultima estrella, perdera sus estrellas y por ende el juego
            }
            if ((Convert.ToInt32(lblpunteoN5DyM.Text) >= limeinfeDyM2_5) && (Convert.ToInt32(lblpunteoN5DyM.Text) <= limesupeDyM2_5))
            {
                picbN5DyM.Image = imgliDIVyMOD.Images[2]; // si se cumple esta condicion el jugador obtendra 2 estrellas
            }
            if ((Convert.ToInt32(lblpunteoN5DyM.Text) >= limiinfeDyM3_5) && (Convert.ToInt32(lblpunteoN5DyM.Text) <= limisupeDyM3_5))
            {
                picbN5DyM.Image = imgliDIVyMOD.Images[3]; // si el usuario es muy pro obtendra 3 estrellas
            }

            tiempo5DIVyMOD--;
            lblpunteoN5DyM.Text = cargarultimoDIVyMOD.quitapunteos_segundosNDIVyMOD5();                                                          // le quito los puntos respectivos a sus segundos

            if ((tiempo5DIVyMOD >= 0) && (Convert.ToInt32(lblpunteoN5DyM.Text) > 0) && (Convert.ToInt32(lblpunteoN5DyM.Text) >= punteminDyM2_5)) // realizo la conidcion para parar el tiempo en dado caso el usuario perdiera
            {
                lbltiempoN5DyM.Text = tiempoDyM1.ToString();
            }
            else
            {
                // si la condicion no se cumple el usuario perdera y tendra que empezar desde el nivel 1
                timerN5DyM.Stop();
                lblpunteoN5DyM.Text = "0";
                picbN5DyM.Image     = imgliDIVyMOD.Images[0];
                MessageBox.Show("Lo siento ha perdido, vuelva a intentarlo");
                Niveles_DIV_MOD perdiste5DyM = new Niveles_DIV_MOD();
                this.Hide();
                perdiste5DyM.ShowDialog();
                this.Close();
            }
        }
Ejemplo n.º 3
0
        private void timerN1DyM_Tick(object sender, EventArgs e)
        {
            //esto de las estrellas lo debi meter a una clase más no pude lograrlo por ello lo deje a lo patito en la forma
            int punteminDyM1_1 = 50000, limiinfeDyM1_1 = 0, limeinfeDyM1_1 = 0, ADyM1_1 = 0, limiinfeDyM3_1 = 0, limesupeDyM1_1 = 0, limesupeDyM2_1 = 0, limisupeDyM3_1 = 0;

            ADyM1_1 = (punteomaxDyM1 - punteminDyM1_1) / 3;  // obtengo A, variable con la cual hare que todo lo demas funcione
            //obtengo los limites inferiores
            limiinfeDyM1_1 = punteminDyM1_1;
            limeinfeDyM1_1 = punteminDyM1_1 + ADyM1_1;
            limiinfeDyM3_1 = punteminDyM1_1 + (2 * ADyM1_1);
            //obtengo los limites superiores
            limesupeDyM1_1 = (punteminDyM1_1 + ADyM1_1) - 1;
            limesupeDyM2_1 = ((punteminDyM1_1 + (2 * ADyM1_1)) - 1);
            limisupeDyM3_1 = punteomaxDyM1;

            //condiciono los intervalos entre del limite inferior y el limite superior
            if ((Convert.ToInt32(lblpunteo1DyM.Text) >= limiinfeDyM1_1) && (Convert.ToInt32(lblpunteo1DyM.Text) <= limesupeDyM1_1))
            {
                picbN1DyM.Image = imgliDIVyMOD.Images[1]; // si se cumple la condicion anterior obtendra 1 estrella
            }
            else
            {
                picbN1DyM.Image = imgliDIVyMOD.Images[0]; // si no se cumple, por ser la ultima estrella, perdera sus estrellas y por ende el juego
            }
            if ((Convert.ToInt32(lblpunteo1DyM.Text) >= limeinfeDyM1_1) && (Convert.ToInt32(lblpunteo1DyM.Text) <= limesupeDyM2_1))
            {
                picbN1DyM.Image = imgliDIVyMOD.Images[2]; // si se cumple esta condicion el jugador obtendra 2 estrellas
            }
            if ((Convert.ToInt32(lblpunteo1DyM.Text) >= limiinfeDyM3_1) && (Convert.ToInt32(lblpunteo1DyM.Text) <= limisupeDyM3_1))
            {
                picbN1DyM.Image = imgliDIVyMOD.Images[3]; // si el usuario es muy pro obtendra 3 estrellas
            }

            tiempoDyM1--;                                                                                                                  // le resto 1 segundo al tiempo que incia en 60 segundos
            lblpunteo1DyM.Text = cargarDyM.quitarpunteos_segundosN1MOD();                                                                  // le quito los puntos respectivos a sus segundos

            if ((tiempoDyM1 >= 0) && (Convert.ToInt32(lblpunteo1DyM.Text) > 0) && (Convert.ToInt32(lblpunteo1DyM.Text) >= punteminDyM1_1)) // realizo la conidcion para parar el tiempo en dado caso el usuario perdiera
            {
                lbltiempo1DyM.Text = tiempoDyM1.ToString();
            }
            else
            {
                // si la condicion no se cumple el usuario perdera y tendra que empezar desde el nivel 1
                timerN1DyM.Stop();
                lblpunteo1DyM.Text = "0";
                picbN1DyM.Image    = imgliDIVyMOD.Images[0];
                MessageBox.Show("Lo siento ha perdido, vuelva a intentarlo");
                Niveles_DIV_MOD perdiste1 = new Niveles_DIV_MOD();
                perdiste1.Show();
                this.Close();
            }
        }