public void reiniciarJuego() { cajas.Clear(); this.generarCajas(30); controladorIA.getOponentes().Clear(); generarOponentes(); camaraInterna = new camara(moto); Camara = camaraInterna; camaraInterna.rotateY(FastMath.ToRad(180)); moto = new Moto(MediaDir, new Vector3(0, 0, 0)); moto.init(); controladorIA.setJugador(moto); perdido = false; }
public void seguirObjetivo(Moto moto, float ElepsedTime, List <CustomVertex.PositionColored[]> obstaculos, List <TgcMesh> cajas) { if (!moto.getPosicion().Equals(new Vector3(0, 0, 0))) { //posicion inicial this.acelerar(ElepsedTime); comprobarColisionSiguienteUpdate(obstaculos, cajas); if (verificarGiro(ElepsedTime)) { if (verificarGiroDerecha(moto, ElepsedTime)) { this.girarDerecha(true); } if (verificarGiroIzquierda(moto, ElepsedTime)) { this.girarIzquierda(true); } } } }
public PowerUp(Vector3 pos) { interpolador = new InterpoladorVaiven(); interpolador.Current = 8; interpolador.Min = 7; interpolador.Max = 28; interpolador.Speed = 40f; esfera = new TgcSphere(); esfera.Position = pos; esfera.setColor(Color.Red); esfera.Radius = 10; esfera.LevelOfDetail = 3; esfera.AutoTransformEnable = true; esfera.updateValues(); tiempo = 10f; moto = null; }
public void setJugador(Moto j) { this.jugador = j; }
public override void tomar(Moto moto) { moto.velocidadMaxima = 600; this.moto = moto; }
public override void Init() { var d3dDevice = D3DDevice.Instance.Device; moto = new Moto(MediaDir, new Vector3(0, 0, 0)); moto.init(); texturaPiso = TgcTexture.createTexture(D3DDevice.Instance.Device, MediaDir + "SkyBoxTron\\bottom.png"); pisoPlane = new TgcPlane(); pisoPlane.Origin = new Vector3(-5000, 0, -5000); pisoPlane.Size = new Vector3(10000, 0, 10000); pisoPlane.Orientation = TgcPlane.Orientations.XZplane; pisoPlane.setTexture(texturaPiso); pisoPlane.updateValues(); piso = pisoPlane.toMesh("piso"); piso.AutoTransformEnable = true; camaraInterna = new camara(moto); Camara = camaraInterna; camaraInterna.rotateY(FastMath.ToRad(180)); skyBoxTron = new SkyBox(MediaDir); skyBoxTron.init(); texto = new TgcText2D(); texto.Color = Color.Red; texto.Align = TgcText2D.TextAlign.LEFT; texto.Text = "Perdiste, toca la tecla R para reiniciar"; texto.Size = new Size(700, 400); texto.Position = new Point(550, 150); textoModoDios = new TgcText2D(); textoModoDios.Color = Color.Red; textoModoDios.Text = "Modo Dios Activado"; textoModoDios.Position = new Point(0, 30); textoModoDios.Size = new Size(500, 200); controladorIA = new ControladorIA(); this.generarOponentes(); perdido = false; cajas = new List <TgcMesh>(); cajaConLuz = new TgcSceneLoader().loadSceneFromFile(MediaDir + Game.Default.pathCajaMetalica).Meshes[0]; cajaConLuz.Position = new Vector3(0, 0, -200); cajaConLuz.Scale = new Vector3(0.8f, 0.8f, 0.8f); efectoLuz = TgcShaders.loadEffect(ShadersDir + "MultiDiffuseLights.fx"); this.generarCajas(100); controladorIA.setObstaculosEscenario(cajas); gestorPowerUps = new GestorPowerUps(); mp3Player = new TgcMp3Player(); mp3Player.closeFile(); mp3Player.FileName = MediaDir + Game.Default.pathMusica; mp3Player.play(true); }
public override void tomar(Moto moto) { this.moto = moto; moto.modoDios = true; }
public abstract void tomar(Moto moto);