private void cmdMundoSuma_Click(object sender, EventArgs e) {// llamo al mundo facil el cual es la suma Niveles_SUMA cargarNxS = new Niveles_SUMA(); this.Hide(); cargarNxS.ShowDialog(); this.Show(); }
private void timerN1S_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 puntemin1 = 50000, limiinfe1 = 0, limeinfe2 = 0, A1 = 0, limiinfe3 = 0, limesupe1 = 0, limesupe2 = 0, limisupe3 = 0; A1 = (punteomax1 - puntemin1) / 3; // obtengo A, variable con la cual hare que todo lo demas funcione //obtengo los limites inferiores limiinfe1 = puntemin1; limeinfe2 = puntemin1 + A1; limiinfe3 = puntemin1 + (2 * A1); //obtengo los limites superiores limesupe1 = (puntemin1 + A1) - 1; limesupe2 = ((puntemin1 + (2 * A1)) - 1); limisupe3 = punteomax1; //condiciono los intervalos entre del limite inferior y el limite superior if ((Convert.ToInt32(lblpunteoN1S.Text) >= limiinfe1) && (Convert.ToInt32(lblpunteoN1S.Text) <= limesupe1)) { picboxestreN1S.Image = imgLiSuma.Images[1]; // si se cumple la condicion anterior obtendra 1 estrella } else { picboxestreN1S.Image = imgLiSuma.Images[0]; // si no se cumple, por ser la ultima estrella, perdera sus estrellas y por ende el juego } if ((Convert.ToInt32(lblpunteoN1S.Text) >= limeinfe2) && (Convert.ToInt32(lblpunteoN1S.Text) <= limesupe2)) { picboxestreN1S.Image = imgLiSuma.Images[2]; // si se cumple esta condicion el jugador obtendra 2 estrellas } if ((Convert.ToInt32(lblpunteoN1S.Text) >= limiinfe3) && (Convert.ToInt32(lblpunteoN1S.Text) <= limisupe3)) { picboxestreN1S.Image = imgLiSuma.Images[3]; // si el usuario es muy pro obtendra 3 estrellas } tiempo1--; // le resto 1 segundo al tiempo que incia en 60 segundos lblpunteoN1S.Text = claseN1deS.punteosN1S(); // le quito los puntos respectivos a sus segundos if ((tiempo1 >= 0) && (Convert.ToInt32(lblpunteoN1S.Text) > 0) && (Convert.ToInt32(lblpunteoN1S.Text) >= puntemin1)) // realizo la conidcion para parar el tiempo en dado caso el usuario perdiera { lbltiempoN1S.Text = tiempo1.ToString(); } else { // si la condicion no se cumple el usuario perdera timerN1S.Stop(); lblpunteoN1S.Text = "0"; picboxestreN1S.Image = imgLiSuma.Images[0]; MessageBox.Show("Lo siento ha perdido, vuelva a intentarlo"); Niveles_SUMA perdiste1 = new Niveles_SUMA(); this.Hide(); perdiste1.ShowDialog(); this.Close(); } }
private void timerN2S_Tick(object sender, EventArgs e) { tiempo2--; lblpunteoN2S.Text = claselvl2S.quitapunteos_segundosN2S(); int puntemin1_2S = 55000, limiinfe1_2S = 0, limeinfe2_2S = 0, A1_2S = 0, limiinfe3_2S = 0, limesupe1_2S = 0, limesupe2_2S = 0, limisupe3_2S = 0; A1_2S = (punteomax2 - puntemin1_2S) / 3; limiinfe1_2S = puntemin1_2S; limeinfe2_2S = puntemin1_2S + A1_2S; limiinfe3_2S = puntemin1_2S + (2 * A1_2S); limesupe1_2S = (puntemin1_2S + A1_2S) - 1; limesupe2_2S = ((puntemin1_2S + (2 * A1_2S)) - 1); limisupe3_2S = punteomax2; /*Me acorte más el trabajo mostrando con una imalist todas las estrellas */ //lo mismo que el nivel 1 cuano esta en la posicion [1] obtendra 1 estrella // posicion [2] obtendra 2 estrellas //posicion [3]obtendra 3 estrellas if ((Convert.ToInt32(lblpunteoN2S.Text) >= limiinfe1_2S) && (Convert.ToInt32(lblpunteoN2S.Text) <= limesupe1_2S)) { picboxestreN2S.Image = imgLiSuma.Images[1]; } else { picboxestreN2S.Image = imgLiSuma.Images[0]; } if ((Convert.ToInt32(lblpunteoN2S.Text) >= limeinfe2_2S) && (Convert.ToInt32(lblpunteoN2S.Text) <= limesupe2_2S)) { picboxestreN2S.Image = imgLiSuma.Images[2]; } if ((Convert.ToInt32(lblpunteoN2S.Text) >= limiinfe3_2S) && (Convert.ToInt32(lblpunteoN2S.Text) <= limisupe3_2S)) { picboxestreN2S.Image = imgLiSuma.Images[3]; } //condicion donde si el usuario no llega a la puntuccion minima perdera el juego if ((tiempo2 >= 0) && (Convert.ToInt32(lblpunteoN2S.Text) > 0) && (Convert.ToInt32(lblpunteoN2S.Text) >= puntemin1_2S)) { lbltimepoN2s.Text = tiempo2.ToString(); } else { timerN2S.Stop(); lblpunteoN2S.Text = "0"; picboxestreN2S.Image = imgLiSuma.Images[0]; MessageBox.Show("Lo siento ha perdido, vuela a intentarlo"); Niveles_SUMA perdiste2 = new Niveles_SUMA(); this.Hide(); perdiste2.ShowDialog(); this.Close(); } }
private void timerN4S_Tick(object sender, EventArgs e) { /*antes de condicionar el tiempo por cada segundo que vaya pasando se le ira quitando cierta cantidad de pntos */ tiempo4S--; lblpunteoN4S.Text = llamarclasslvS4.quitapunteos_segundosNS4(); /*ahora obtengo las estrellas para este nivel, lo tendre que pasar a la clase si me da tiempo */ int puntemin1_4S = 65000, limiinfe1_4S = 0, limeinfe2_4S = 0, A1_4S = 0, limiinfe3_4S = 0, limesupe1_4S = 0, limesupe2_4S = 0, limisupe3_4S = 0; A1_4S = (punteomax4S - puntemin1_4S) / 3; limiinfe1_4S = puntemin1_4S; limeinfe2_4S = puntemin1_4S + A1_4S; limiinfe3_4S = puntemin1_4S + (2 * A1_4S); limesupe1_4S = (puntemin1_4S + A1_4S) - 1; limesupe2_4S = ((puntemin1_4S + (2 * A1_4S)) - 1); limisupe3_4S = punteomax4S; // si el ususario no respeta las condiciones para este nivel no podra pasar de nivel // con el tema de las estrellas es el mimso caso en cada posicion que estás esten jugando if ((Convert.ToInt32(lblpunteoN4S.Text) >= limiinfe1_4S) && (Convert.ToInt32(lblpunteoN4S.Text) <= limesupe1_4S)) { picboxestreN4S.Image = imgLiSuma.Images[1]; } else { picboxestreN4S.Image = imgLiSuma.Images[0]; } if ((Convert.ToInt32(lblpunteoN4S.Text) >= limeinfe2_4S) && (Convert.ToInt32(lblpunteoN4S.Text) <= limesupe2_4S)) { picboxestreN4S.Image = imgLiSuma.Images[2]; } if ((Convert.ToInt32(lblpunteoN4S.Text) >= limiinfe3_4S) && (Convert.ToInt32(lblpunteoN4S.Text) <= limisupe3_4S)) { picboxestreN4S.Image = imgLiSuma.Images[3]; } if ((tiempo4S >= 0) && (Convert.ToInt32(lblpunteoN4S.Text) > 0) && (Convert.ToInt32(lblpunteoN4S.Text) >= puntemin1_4S)) { lbltiempoN3S.Text = tiempo3.ToString(); } else { timerN4S.Stop(); lblpunteoN4S.Text = "0"; picboxestreN4S.Image = imgLiSuma.Images[0]; MessageBox.Show("Lo siento ha perdido, vuela a intentarlo"); Niveles_SUMA perdiste4 = new Niveles_SUMA(); this.Hide(); perdiste4.ShowDialog(); this.Close(); } }
private void timerN5S_Tick(object sender, EventArgs e) { int puntemin1_5S = 70000, limiinfe1_5S = 0, limeinfe2_5S = 0, A1_5S = 0, limiinfe3_5S = 0, limesupe1_5S = 0, limesupe2_5S = 0, limisupe3_5S = 0; A1_5S = (punteomax5S - puntemin1_5S) / 3; //limites inferiores limiinfe1_5S = puntemin1_5S; limeinfe2_5S = puntemin1_5S + A1_5S; limiinfe3_5S = puntemin1_5S + (2 * A1_5S); //limites superiores limesupe1_5S = (puntemin1_5S + A1_5S) - 1; limesupe2_5S = ((puntemin1_5S + (2 * A1_5S)) - 1); limisupe3_5S = punteomax5S; // si el usuario no llegara al punteominimo perdera o bien si el timepo llegara a 0 if ((Convert.ToInt32(lblpunteoN5S.Text) >= limiinfe1_5S) && (Convert.ToInt32(lblpunteoN5S.Text) <= limesupe1_5S)) { picbestreN5S.Image = imgLiSuma.Images[1]; } else { picbestreN5S.Image = imgLiSuma.Images[0]; } if ((Convert.ToInt32(lblpunteoN5S.Text) >= limeinfe2_5S) && (Convert.ToInt32(lblpunteoN5S.Text) <= limesupe2_5S)) { picbestreN5S.Image = imgLiSuma.Images[2]; } if ((Convert.ToInt32(lblpunteoN5S.Text) >= limiinfe3_5S) && (Convert.ToInt32(lblpunteoN5S.Text) <= limisupe3_5S)) { picbestreN5S.Image = imgLiSuma.Images[3]; } tiempo5S--; lblpunteoN5S.Text = cargarlvl5_Suma.quitapunteos_segundosNS5(); // esta condicion contiene la misma sintaxis que las otras solo varian las variables if ((tiempo5S >= 0) && (Convert.ToInt32(lblpunteoN5S.Text) > 0) && (Convert.ToInt32(lblpunteoN5S.Text) >= puntemin1_5S)) { lbltiempoN5S.Text = tiempo5S.ToString(); } else { timerN5S.Stop(); lblconteoN5S.Text = "0"; picbestreN5S.Image = imgLiSuma.Images[0]; MessageBox.Show("Lo siento ha perdido, vuela a intentarlo"); // mostrar mensaje de volver a intentarlo Niveles_SUMA perdiste5 = new Niveles_SUMA(); // reinicir la tab this.Hide(); perdiste5.ShowDialog(); this.Close(); } }
private void timerN3S_Tick(object sender, EventArgs e) { tiempo3--; lblpuntosN3S.Text = cargarclaslvS3.quitapunteos_segundosN3S(); /*quito los puntos por segundo que serian 2000 por segundo*/ int puntemin1_3S = 60000, limiinfe1_3S = 0, limeinfe2_3S = 0, A1_3S = 0, limiinfe3_3S = 0, limesupe1_3S = 0, limesupe2_3S = 0, limisupe3_3S = 0; A1_3S = (punteomax3 - puntemin1_3S) / 3; limiinfe1_3S = puntemin1_3S; limeinfe2_3S = puntemin1_3S + A1_3S; limiinfe3_3S = puntemin1_3S + (2 * A1_3S); limesupe1_3S = (puntemin1_3S + A1_3S) - 1; limesupe2_3S = ((puntemin1_3S + (2 * A1_3S)) - 1); limisupe3_3S = punteomax3; // PARA LAS IMAGENES SUCEDERA LO MISMO SIEMPRE RESPETANDO SUS RESPECTIVAS CONDICIONES CON los intervalos entre // limite inferior y superior respetivo a c/nivel if ((Convert.ToInt32(lblpuntosN3S.Text) >= limiinfe1_3S) && (Convert.ToInt32(lblpuntosN3S.Text) <= limesupe1_3S)) { picestreN3S.Image = imgLiSuma.Images[1]; } else { picestreN3S.Image = imgLiSuma.Images[0]; } if ((Convert.ToInt32(lblpuntosN3S.Text) >= limeinfe2_3S) && (Convert.ToInt32(lblpuntosN3S.Text) <= limesupe2_3S)) { picestreN3S.Image = imgLiSuma.Images[2]; } if ((Convert.ToInt32(lblpuntosN3S.Text) >= limiinfe3_3S) && (Convert.ToInt32(lblpuntosN3S.Text) <= limisupe3_3S)) { picestreN3S.Image = imgLiSuma.Images[3]; } if ((tiempo3 >= 0) && (Convert.ToInt32(lblpuntosN3S.Text) > 0) && (Convert.ToInt32(lblpuntosN3S.Text) >= puntemin1_3S)) { lbltiempoN3S.Text = tiempo3.ToString(); } else { timerN3S.Stop(); lblpuntosN3S.Text = "0"; picestreN3S.Image = imgLiSuma.Images[0]; MessageBox.Show("Lo siento ha perdido, vuela a intentarlo"); Niveles_SUMA perdiste3 = new Niveles_SUMA(); this.Hide(); perdiste3.ShowDialog(); this.Close(); } }