public void MalPaso() { TocarSonidos(MainGame.Efectos.Mal1, MainGame.Efectos.Mal2); //indicador de mal wrong.SetActive(true); m_animadorJugador.SetInteger("Direccion", 5); //Evitamos que una animacion no se ejecute siempre m_animadorJugador.Update(0); // Lo que hace es ejecutar un 0 para refrescar la animacion digamos, y luego le pasmaos un 0. m_animadorJugador.SetInteger("Direccion", 0); //decrementar vidas i_lives--; updateLives(); if (i_lives < 1) { EstadoBase.CambiarEstado(EstadoFinDeJuego.Instancia); } else { EstadoBase.CambiarEstado(EstadoFinJugador.Instancia); } }
// Update is called once per frame void Update() { EstadoBase.ActualizarEstadoActual(); ActualizaEmprezar(); //if (Input.GetMouseButtonDown(0)) // GameObject.Destroy(m_miChica); }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; if (m_reloj > m_duracion) { EstadoBase.Cambiar(EstadoIrProfesor.Instancia); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; //Si el reloj ha llegado a la duracion.... if (m_reloj > m_duracion) { EstadoBase.CambiarEstado(EstadoIrProfesor.Instancia); } }
// Start is called before the first frame update // Que es lo que primero va a ocurrir cuando inicie el juego void Start() { // m_miChica = GameObject.Instantiate(m_chica); ReiniciarJuego(); AddNewStep(); AddNewStep(); AddNewStep(); EstadoBase.SetGame(this);//asigandno al valor EstadoBase.Cambiar(EstadoIrProfesor.Intancia); }
void Start() { ReiniciarJuego(); AddNewStep(); AddNewStep(); AddNewStep(); EstadoBase.SetGame(this); EstadoBase.Cambiar(EstadoIrProfesor.Instancia); }
public static void Cambiar(EstadoBase nuevoEstado) { if (m_actual != null) { m_actual.End(m_game); } m_actual = nuevoEstado; if (m_actual != null) { m_actual.Start(m_game); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; if (m_reloj > m_duracion) { m_reloj = 0; if (!game.MuestraSiguientePaso(game.m_animadorMaestro)) { EstadoBase.Cambiar(EstadoIrJugador.Instancia); } } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime;//sumar al tiempor transcurrido entre frame y frame if (m_reloj > m_duracion) { m_reloj = 0; if (!game.MuestreSiguientePaso(game.m_animadorMaestro)) { EstadoBase.Cambiar(EstadoIrJugador.Intancia); } } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime;//sumar al tiempor transcurrido entre frame y frame if (m_reloj > m_duracion) { EstadoBase.Cambiar(EstadoIrProfesor.Intancia); } //else //{ // //que el tiempo de hacer el mov termino entonces marco mal paso // game.MalPaso(); //} }
public override void Update(MainGame game) { m_reloj += Time.deltaTime;//sumar al tiempor transcurrido entre frame y frame if (m_reloj > m_duracion) { EstadoBase.Cambiar(EstadoProfesor.Intancia); } else { m_currentTarget = Vector3.Lerp(m_currentTarget, game.m_maestro.transform.position, m_reloj / m_duracion); game.m_camaraPrincipal.transform.LookAt(m_currentTarget + Vector3.up);//que mire a la posicion actual } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; if (m_reloj > m_duracion) { EstadoBase.Cambiar(EstadoJugador.Instancia); } else { m_currentTarget = Vector3.Lerp(m_currentTarget, game.m_jugador.transform.position, m_reloj / m_duracion); game.m_camaraPrincipal.transform.LookAt(m_currentTarget + Vector3.up); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; //Si el reloj ha llegado a la duracion.... if (m_reloj > m_duracion) { EstadoBase.CambiarEstado(EstadoProfesor.Instancia); } else { m_currentTarget = Vector3.Lerp(m_currentTarget, game.m_maestro.transform.position, m_reloj / m_duracion); game.m_camaraPrincipal.transform.LookAt(m_currentTarget + Vector3.up); } }
public void MalPaso() { TocarSonido(MainGame.Efectos.Mal1, MainGame.Efectos.Mal2); m_mal.SetActive(true); m_animadorJugador.SetInteger("Direccion", 5); m_animadorJugador.Update(0); m_animadorJugador.SetInteger("Direccion", 0); m_nVidas--; ActualizaVidas(); if (m_nVidas < 1) { EstadoBase.Cambiar(EstadoFinJuego.Instancia); } else { EstadoBase.Cambiar(EstadoFinJugador.Instancia); } }
public void MalPaso() { TocarSonido(MainGame.Efectos.Mal1, MainGame.Efectos.Mal2); m_Fall.SetActive(true); m_animadorJugador.SetInteger("Direccion", 5); m_animadorJugador.Update(0); m_animadorJugador.SetInteger("Direccion", 0); m_nVidas--; ActualizarVidas(); if (m_nVidas < 1) { //finalizar Parti EstadoBase.Cambiar(EstadoFinJuego.Intancia); } else//se entra en un nuevos estado { EstadoBase.Cambiar(EstadoFinJugador.Intancia); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; if (m_reloj > m_duracion) { m_reloj = 0; if (!game.ShowMeNextStep(game.m_animadorMaestro)) { EstadoBase.CambiarEstado(EstadoIrJugador.Instancia); //Cuando el profesor termina de hacer la animacion debemos quitarle el valor para que deje de ejecutar esa animacion } // EstadoBase.CambiarEstado(EstadoProfesor.Instancia); } else { } }
// Use this for initialization void Start() { MaxScore.enabled = false; currentScore.enabled = false; //Comparamos maximas puntuaciones compararMaximasPuntuaciones(); //On start we restart the game and we add 3 new steps. RestartGame(); // new steps AddNewStep(); AddNewStep(); AddNewStep(); //Le decimos a la clase estado base que cambie al estado estado ir profesor EstadoBase.SetGame(this); EstadoBase.CambiarEstado(EstadoIrProfesor.Instancia); }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; //Si el reloj ha llegado a la duracion.... if (m_reloj < m_duracion) { MainGame.StepTipe step = ControlTeclado(); if (step != MainGame.StepTipe.None) //Comprobamos que el paso sea diferente a NONE. { m_reloj = 0; // le preguntamos al juego si el paso introducido por el usuario es el esperado. if (game.CompruebaPaso(game.m_animadorJugador, step)) //En caso de que si.... { game.addPoints(100); //Sumamos 100 puntos al usuario if (game.HaTerminado()) //Y vemos si el juego esta terminado... Si es false... { game.TocarSonidos(MainGame.Efectos.Bien1, MainGame.Efectos.Bien2, MainGame.Efectos.Bien3); game.AddNewStep(); //Añadimos un nuevo paso que será introducido por el usuario para que lo repita la maquina EstadoBase.CambiarEstado(EstadoFinJugador.Instancia); } return; } else { game.MalPaso(); } } else { return; } //Puedo marcar mi movimiento } else { game.MalPaso(); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; //sumar al tiempor transcurrido entre frame y frame if (m_reloj < m_duracion) //si es menor { //puedo marcar mi mov MainGame.TipoPaso paso = ControlTeclado(); if (paso != MainGame.TipoPaso.None)//que realmente se pulso algo { m_reloj = 0; if (game.CompruebaPaso(game.m_animadorJugador, paso)) { game.SumaPuntuacion(100); if (game.HaTerminado()) { game.TocarSonido(MainGame.Efectos.Bien1, MainGame.Efectos.Bien2); game.AddNewStep(); EstadoBase.Cambiar(EstadoFinJugador.Intancia); } return; } else { game.MalPaso(); } } else { return; } } else { //que el tiempo de hacer el mov termino entonces marco mal paso game.MalPaso(); } }
public override void Update(MainGame game) { m_reloj += Time.deltaTime; if (m_reloj < m_duracion) { MainGame.TipoPaso paso = ControlTeclado(); if (paso != MainGame.TipoPaso.None) { m_reloj = 0; if (game.CompruebaPaso(game.m_animadorJugador, paso)) { game.SumaPuntuacion(100); if (game.HaTerminado()) { game.TocarSonido(MainGame.Efectos.Bien1, MainGame.Efectos.Bien2); game.AddNewStep(); EstadoBase.Cambiar(EstadoFinJugador.Instancia); } return; } else { game.MalPaso(); } } else { return; } // Puedo marcar mi moviento } else { game.MalPaso(); } }
public EstadoController() { var estados = new EstadoBase(); _estados = estados.Estados; }
// Update is called once per frame void Update() { EstadoBase.Actualizar(); ActualizaEmpezar(); }