void Update() { if (Tiempo_De_Espera_Despues_Del_Tap >= 0 && DeltaTime > 0) { Tiempo_De_Espera_Despues_Del_Tap -= Time.deltaTime * 1; if (Tiempo_De_Espera_Despues_Del_Tap <= 0) { Tap_Final = Tap_Del_Jugador; Tap_Del_Jugador = 0; condicion.RevisionResultado(Tap_Final, ListaNumeros[Numero_De_Focos_Prendidos], Numero_De_Focos_Prendidos); PrenderLed(Numero_De_Focos_Prendidos); } } if (Jugando == true && DeltaTime > 0) { MouseClik(); DeltaTime -= Time.deltaTime * 1; tiempoEngine.TiempoJuego(DeltaTime); //victoriaEngin.condiciondevictoria(Numero_De_Focos_Prendidos, RevisarEscena.FocosParaNivel); if (victoriaEngin.condiciondevictoria(Numero_De_Focos_Prendidos, RevisarEscena.FocosParaNivel) == true) { SceneManager.LoadScene("02Menu"); } //derrotaEngine.RevisarTiempo(DeltaTime); if (derrotaEngine.RevisarTiempo(DeltaTime) == true) { SceneManager.LoadScene("02Menu"); } TxtTiempo.text = DeltaTime.ToString("F0"); } TxtTaps.text = Tap_Del_Jugador.ToString(); }
public void CondicionVictoriaTestSimplePasses() { int _FocosPrendidos = 5; int _FocosParaGanar = 5; var engine = new CondicionVictoria(); bool result = engine.condiciondevictoria(_FocosPrendidos, _FocosParaGanar); Assert.IsTrue(result); }
void Update() { if (Tiempo_De_Espera_Despues_Del_Tap >= 0 && DeltaTime > 0) { Tiempo_De_Espera_Despues_Del_Tap = _deltaTime.restarTiempo(Tiempo_De_Espera_Despues_Del_Tap, Time.deltaTime); if (Tiempo_De_Espera_Despues_Del_Tap <= 0) { Tap_Final = Tap_Del_Jugador; Tap_Del_Jugador = 0; condicion.RevisionResultado(Tap_Final, ListaNumeros[Numero_De_Focos_Prendidos], Numero_De_Focos_Prendidos); PrenderLed(Numero_De_Focos_Prendidos); } } if (Jugando == true && DeltaTime > 0) { TeclaESC(); MouseClik(); DeltaTime = _deltaTime.restarTiempo(DeltaTime, Time.deltaTime); tiempoEngine.TiempoJuego(DeltaTime); //////////////////////////////////////////////////// GANO EL JUGADOR if (victoriaEngin.condiciondevictoria(Numero_De_Focos_Prendidos, RevisarEscena.FocosParaNivel) == true) { IMG_Ganar.SetActive(true); TxtHighScore.text = PlayerPrefs.GetFloat(Nombre_Del_Player_Prefs_De_Este_Nivel).ToString("F2"); TxtMyScore.text = _highScore._HighScore(DeltaTime, MiHighScoreParaEsteNivel, Nombre_Del_Player_Prefs_De_Este_Nivel).ToString("F2"); Debug.Log(PlayerPrefs.GetFloat(Nombre_Del_Player_Prefs_De_Este_Nivel)); Jugando = false; } //////////////////////////////////////////////////// PERDIO EL JUGADOR if (derrotaEngine.RevisarTiempo(DeltaTime) == true) { Explocion.SetActive(true); IMG_Perder.SetActive(true); Jugando = false; } TxtTiempo.text = DeltaTime.ToString("F0"); } TxtTaps.text = Tap_Del_Jugador.ToString(); }
void Update() { if (OnlineInitializer.OnlinePlayers > 1 && imking == true) { wait.SetActive(false); musicon = true; Time.timeScale = 1; } if (musicon == true && sonando == false) { sonando = true; musicon = false; soundtrack.Play(); } if (!gameOver) { if (Tiempo_De_Espera_Despues_Del_Tap >= 0 && DeltaTime > 0) { Tiempo_De_Espera_Despues_Del_Tap = _deltaTime.restarTiempo(Tiempo_De_Espera_Despues_Del_Tap, Time.deltaTime); if (Tiempo_De_Espera_Despues_Del_Tap <= 0) { Tap_Final = Tap_Del_Jugador; Tap_Del_Jugador = 0; condicion.RevisionResultado(Tap_Final, ListaNumeros[Numero_De_Focos_Prendidos], Numero_De_Focos_Prendidos); PrenderLed(Numero_De_Focos_Prendidos); } } if (Jugando == true && DeltaTime > 0) { MouseClik(); DeltaTime = _deltaTime.restarTiempo(DeltaTime, Time.deltaTime); tiempoEngine.TiempoJuego(DeltaTime); if (victoriaEngin.condiciondevictoria(Numero_De_Focos_Prendidos, RevisarEscena.FocosParaNivel) == true) { //IMG_Ganar.SetActive(true); localWinner = true; Jugando = false; CmdChangeGameOver(); } if (derrotaEngine.RevisarTiempo(DeltaTime) == true) { //IMG_Perder.SetActive(true); Jugando = false; localWinner = false; CmdChangeGameOver(); } TxtTiempo.text = DeltaTime.ToString("F0"); } TxtTaps.text = Tap_Del_Jugador.ToString(); } else if (localWinner) { //////////////////////////////////////////////////// GANO EL JUGADOR IMG_Ganar.SetActive(true); } else { //////////////////////////////////////////////////// PERDIO EL JUGADOR IMG_Perder.SetActive(true); } }