private void cmdOpLogi_Click(object sender, EventArgs e) {// llamo al mundo de operaciones lógicas Niveles_Opera_Logicos llamarMuOPL = new Niveles_Opera_Logicos(); this.Hide(); llamarMuOPL.ShowDialog(); this.Show(); }
private void timerN1OPL_Tick_1(object sender, EventArgs e) { // preparo el tiempo, estrellas y si pierde el mensaje de que perdio. int punteminOl1 = 50000, limiinfeOl1 = 0, limeinfeOL2 = 0, AOL1 = 0, limiinfeOL3 = 0, limesupeOL1 = 0, limesupeOL2 = 0, limisupeOL3 = 0; AOL1 = (punteomaxOL1 - punteminOl1) / 3; // obtengo A, variable con la cual hare que todo lo demas funcione //obtengo los limites inferiores limiinfeOl1 = punteminOl1; limeinfeOL2 = punteminOl1 + AOL1; limiinfeOL3 = punteminOl1 + (2 * AOL1); //obtengo los limites superiores limesupeOL1 = (punteminOl1 + AOL1) - 1; limesupeOL2 = ((punteminOl1 + (2 * AOL1)) - 1); limisupeOL3 = punteomaxOL1; //condiciono los intervalos entre del limite inferior y el limite superior if ((Convert.ToInt32(lblpunteoN1OL.Text) >= limiinfeOl1) && (Convert.ToInt32(lblpunteoN1OL.Text) <= limesupeOL1)) { picestreOLN1.Image = imLOL1.Images[1]; // si se cumple la condicion anterior obtendra 1 estrella } else { picestreOLN1.Image = imLOL1.Images[0]; // si no se cumple, por ser la ultima estrella, perdera sus estrellas y por ende el juego } if ((Convert.ToInt32(lblpunteoN1OL.Text) >= limeinfeOL2) && (Convert.ToInt32(lblpunteoN1OL.Text) <= limesupeOL2)) { picestreOLN1.Image = imLOL1.Images[2]; // si se cumple esta condicion el jugador obtendra 2 estrellas } if ((Convert.ToInt32(lblpunteoN1OL.Text) >= limiinfeOL3) && (Convert.ToInt32(lblpunteoN1OL.Text) <= limisupeOL3)) { picestreOLN1.Image = imLOL1.Images[3]; // si el usuario es muy pro obtendra 3 estrellas } tiempoOL1--; // le resto 1 segundo al tiempo que incia en 60 segundos lblpunteoN1OL.Text = cargarnivelesOL1.punteos_SegundosN1OL(); // le quito los puntos respectivos a sus segundos if ((tiempoOL1 >= 0) && (Convert.ToInt32(lblpunteoN1OL.Text) > 0) && (Convert.ToInt32(lblpunteoN1OL.Text) >= punteminOl1)) // realizo la conidcion para parar el tiempo en dado caso el usuario perdiera { lbltiempoN1OL.Text = tiempoOL1.ToString(); } else { // si la condicion no se cumple el usuario perdera timerN1OPL.Stop(); lblpunteoN1OL.Text = "0"; picestreOLN1.Image = imLOL1.Images[0]; MessageBox.Show("Lo siento ha perdido, vuelva a intentarlo"); Niveles_Opera_Logicos perdiste1OL = new Niveles_Opera_Logicos(); this.Hide(); perdiste1OL.ShowDialog(); this.Close(); } }