Example #1
0
        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));
        }
Example #2
0
        public override void init()
        {
            GuiController.Instance.Modifiers.addFloat("zoom", 2f, 5f, 3f);
            GuiController.Instance.Modifiers.addBoolean("huellas", "Mostrar huellas", true);
            GuiController.Instance.Modifiers.addBoolean("nieve", "Mostrar nieve", true);

            Device d3dDevice = GuiController.Instance.D3dDevice;

            juego = Juego.getInstance();
            vida = Vida.getInstance();
            vida.initialize();

            //ppManager = new PostProcesadoManager(this);

            camara = new TgcFpsMiCamara();
            camara.Enable = true;
            camara.setCamera(new Vector3(-200, 40, 0), new Vector3(0, 10, 0));
            camara.MovementSpeed = 150;

            soundManager = SoundManager.getInstance();
            contadorBalas = ContadorBalas.getInstance();
            escenarioManager = new EscenarioManager();

            escenarioManager.generarPosiciones();
            escenarioManager.generarBosque(500, 200, 40);

            octree = new Octree();
            octree.create(escenarioManager.getOptimizables(), escenarioManager.limites);
            octree.createDebugOctreeMeshes();

            enemigosManager = new EnemigosManager(escenarioManager);
            enemigosManager.generarEnemigos(Juego.Instance.totalEnemigos);

            Juego.Instance.manejoEnemigos(enemigosManager);

            contadorEnemigos = new ContadorEnemigos();

            armaManager = ArmaManager.getInstance(enemigosManager, camara, escenarioManager);

            indicadores = new Indicadores();

            camara.setEscenarioManger(escenarioManager);

            finalJuego = new GameOver();

            huellaManager = new HuellasManager(25);

            nieve = new Nieve(3000, 3000, 200);
            clima = new Clima(nieve, soundManager);
        }