public Enemigo(Vector3 posicionInicial, EscenarioManager escenarioManager) { this.huellas = new HuellasManager(10); this.teMataron = false; this.escenarioManager = escenarioManager; this.enemigoAmigacion = Enemigo.getAnimacion(); this.mesh = Enemigo.getMesh(); sangre = new TgcCylinder(posicionInicial, 0, 20, 0); sangre.Color = Color.Red; sangre.updateValues(); enemigoEsfera = new TgcBoundingSphere(new Vector3(posicionInicial.X, 30, posicionInicial.Z), 10); Random rnd = new Random(); mesh.Position = posicionInicial; mesh.Scale = new Vector3(1f, 1f, 1f); mesh.AutoTransformEnable = true; this.cabezaBounding = new TgcBoundingSphere(new Vector3(posicionInicial.X, posicionInicial.Y + 20, posicionInicial.Z), 20); this.setEstado(new EnemigoQuieto(this)); }
public Bala(Vector3 pos, float anguloRotacion, float anguloElevacion, Canion canion, bool soyPlayer, float velBala, float g) { bullet = new TgcSphere(); bullet.setColor(Color.Black); bullet.Radius = RADIO; bullet.Position = pos; posicion = pos; bullet.LevelOfDetail = 1; this.anguloRotacion = anguloRotacion; this.anguloElevacion = anguloElevacion; this.speed = velBala; this.verticalAcceleration = g; bullet.updateValues(); bullet.AutoTransformEnable = false; this.canion = canion; canion.agregarBalaEnElAire(this); sombra = new TgcSphere(RADIO, Color.Black, new Vector3(pos.X, EjemploAlumno.Instance.alturaOla(pos), pos.Z)); sombra.updateValues(); sombra.AutoTransformEnable = false; sombra.Effect = EjemploAlumno.Instance.efectoSombra; sombra.Technique = "SombraBala"; //sombra.AlphaBlendEnable = true; salpicadura = new TgcCylinder(pos, RADIO, 10); salpicadura.Color = Color.White; salpicadura.UseTexture = true; salpicadura.setTexture(TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "4141-diffuse.jpg"));//"el-agua-cae-textura-del-fondo-11558332.jpg")); salpicadura.updateValues(); salpicadura.AutoTransformEnable = false; salpicadura.Effect = TgcShaders.loadEffect(GuiController.Instance.AlumnoEjemplosMediaDir + "shader agua.fx"); salpicadura.Technique = "SalpicaduraBala"; this.soyPlayer = soyPlayer; verticalSpeed = speed * (float)Math.Sin(anguloElevacion); }