public Linterna(TgcMesh nuevoMesh, TgcMesh nuevoMesh2, GameModel gameModel)
 {
     this.mesh2        = nuevoMesh2;
     this.mesh1        = nuevoMesh;
     this.gameModel    = gameModel;
     sonidoInterruptor = new Sonido("Click2-Sebastian-759472264.wav", -3000, false);
 }
Example #2
0
 public void InstanciarMonster(monstruos tipo)
 {
     ghost            = ConfiguradorMonstruo.ConfigurarMonstruo(tipo);
     SonidosRandoms   = ConfiguradorMonstruo.ConfigurarSonidosRandoms();
     sonidoAtrapa3    = ConfiguradorMonstruo.ObtenerSonidoDeGameOver();
     this.lookAt      = new TGCVector3(ghost.Position);
     VelocidadMonster = 500f;
 }
Example #3
0
 internal void InstanciarMonster(Personaje personaje, TGCVector3 posicionDeAlejamiento, monstruos tipo)
 {
     //Solo nos interesa el primer modelo de esta escena (tiene solo uno)
     ghost           = ConfiguradorMonstruo.ConfigurarMonstruo(tipo);
     SonidosRandoms  = ConfiguradorMonstruo.ConfigurarSonidosRandoms();
     sonidoAtrapa3   = ConfiguradorMonstruo.ObtenerSonidoDeGameOver();
     ghost.Position  = new TGCVector3(posicionDeAlejamiento);
     ghost.Transform = TGCMatrix.Translation(posicionDeAlejamiento.X, posicionDeAlejamiento.Y - 100, posicionDeAlejamiento.Z);
     this.lookAt     = new TGCVector3(ghost.Rotation);
     RotarMesh(personaje);
 }
 public Vehiculo(TgcMesh Mesh, TwistedMetal env) : base(env)
 {
     base.setMesh(Mesh);
     //  base.getMesh().(pos);
     base.setVelocidadY(0);
     base.setAluraMaxima(20);
     //      direcionadores();
     sonidoPorDaño   = new Sonido(env.MediaDir, env.ShadersDir, env.DirectSound);
     sonidoPorMuerte = new Sonido(env.MediaDir, env.ShadersDir, env.DirectSound);
     updateTGCArrow();
     iniciarNivelDeVida();
     iniciarWeaponCount();
     iniciarHumo();
 }
Example #5
0
        public override void Update()
        {
            PreUpdate();


            if (!estoyJugando)
            {
                estoyJugando = Input.keyDown(Key.Space) && !estoyEnElMenu;
                if (estoyJugando)
                {
                    sonidoBarra = new Sonido("AllAroundYou.wav", false);
                    var sonidoStart = new Sonido("auto, abrir puerta.wav", -3000, false);
                    sonidoStart.escucharSonidoActual(false);
                }
            }
            else
            {
                this.musicaMenu.DetenerSonido();
                UpdateGame();
            }

            PostUpdate();
        }
 public Puerta(TgcMesh mesh)
 {
     sonidoApertura = new Sonido("puerta ruidosa, abrir.wav", -3900, false);
     sonidoCierre   = sonidoApertura; //as tincho asked
     meshAsociado   = mesh;
 }
        /// <summary>
        ///     Se llama una sola vez, al principio cuando se ejecuta el ejemplo.
        ///     Escribir aquí todo el código de inicialización: cargar modelos, texturas, estructuras de optimización, todo
        ///     procesamiento que podemos pre calcular para nuestro juego.
        ///     Borrar el codigo ejemplo no utilizado.
        /// </summary>
        public override void Init()
        {
            //startGame();

            var d3dDevice = D3DDevice.Instance.Device;

            sonido   = new Sonido(MediaDir, ShadersDir, DirectSound);
            messages = new PrintMessageText(this);

            //Carga la estructura de la ciudad
            manejadorDeColiciones  = new ManejadorDeColisiones();
            controladorDeVehiculos = new ControladorDeVehiculos(this);
            Ciudad = new Ciudad(this);

            cronometro = new Cronometro(300000, this);
            //sonidos.startGame();
            iniciarIluminacion();

            TgcD3dInput input = new TgcD3dInput();

            Input = input;

            camaraRotante = new TgcRotationalCamera(
                new Vector3(3000, 5, 3000), 2000, 0.15f, 10f, base.Input);

            camaraMenu = new CamaraTerceraPersona(new Vector3(5500, 800, 5500), 900, 3600f);

            this.Camara = camaraRotante;
            //camaraRotante.SetCamera(new Vector3(500, 700, 500),
            //                         new Vector3(3000, 50, 3000));

            //Creamos una caja 3D con textura
            var center  = new Vector3(3000, 200, 4500);
            var texture = TgcTexture.createTexture(MediaDir + "Menu\\COMENZAR.png");

            boxComenzar = TgcBox.fromSize(center, new Vector3(250, 50, 50), texture);
            boxComenzar.AutoTransformEnable = false;

            // Creamos una caja 3D con textura
            center       = new Vector3(3000, 140, 4500);
            texture      = TgcTexture.createTexture(MediaDir + "Menu\\PERSONAJE.png");
            boxPersonaje = TgcBox.fromSize(center, new Vector3(250, 50, 50), texture);
            boxPersonaje.AutoTransformEnable = false;

            // Creamos una caja 3D con textura
            center   = new Vector3(3000, 80, 4500);
            texture  = TgcTexture.createTexture(MediaDir + "Menu\\SALIR.png");
            boxSalir = TgcBox.fromSize(center, new Vector3(250, 50, 50), texture);
            boxSalir.AutoTransformEnable = false;

            boxComenzar.Position = new Vector3(5500, 850, 5600);
            boxComenzar.rotateY(FastMath.PI);
            boxPersonaje.Position = new Vector3(5500, 750, 5600);
            boxPersonaje.rotateY(FastMath.PI);
            boxSalir.Position = new Vector3(5500, 650, 5600);
            boxSalir.rotateY(FastMath.PI);

            var loader = new TgcSceneLoader();
            var scene  = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vehiculos\\Hummer\\Hummer-TgcScene.xml");

            personaje1 = scene.Meshes[0];
            personaje1.AutoTransformEnable = false;
            personaje1.Position            = new Vector3(5400, 800, 5700);

            scene      = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vehiculos\\Auto\\Auto-TgcScene.xml");
            personaje2 = scene.Meshes[0];
            personaje2.AutoTransformEnable = false;
            personaje2.Position            = new Vector3(5200, 800, 5700);

            scene      = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vehiculos\\Patrullero\\Patrullero-TgcScene.xml");
            personaje3 = scene.Meshes[0];
            personaje3.AutoTransformEnable = false;
            personaje3.Position            = new Vector3(5000, 800, 5700);

            scene      = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vehiculos\\Warthog\\Warthog-TgcScene.xml");
            personaje4 = scene.Meshes[0];
            personaje4.AutoTransformEnable = false;
            personaje4.Position            = new Vector3(5000, 800, 5700);

            TwistedMetal.inicializado = true;

            /*controladorDeVehiculos.crearAutoPrincipal();
             * controladorDeVehiculos.crearEnemigo1();
             * autoPrincipal = controladorDeVehiculos.getAutoPrincipal();
             *
             */

            //niebla = new Niebla(this);
            // niebla.CargarCamara(controladorDeVehiculos.getAutoPrincipal().getCamara());
            //  niebla
            //     controladorDeVehiculos.addToColisionador(manejadorDeColiciones);//por ahora los autos no colisionan
            //cargarShaders();
        }
Example #8
0
        public override void Init()
        {
            var d3dDevice = D3DDevice.Instance.Device;

            deviceMusica         = DirectSound.DsDevice;
            this.FixedTickEnable = false;

            GameModel.instancia = this;
            musicaMenu          = new Sonido("SonidoPruebaTGC(Mono).wav", true);
            musicaFondoOutdoor  = new Sonido("nocturno, continuo.wav", -3000, true);
            estatica            = new Sonido("Radio Static-SoundBible.com-629277574.wav", -2500, true);
            agarrarPagina       = new Sonido("Page_Turn-Mark_DiAngelo-1304638748.wav", -300, false);
            humanHeartbeat      = new Sonido("human-heartbeat-daniel_simon.wav", -1000, false);
            respiracion         = new Sonido("Breathing Vent-SoundBible.com-18702822.wav", -600, false);

            //CreateFullScreenQuad();
            CreateRenderTarget();

            personaje = new Personaje();
            menu.instanciarMenu();
            nota.instanciarNotas(0);
            vidaUtilVela.instanciarVelas(0);
            velita.instanciarVelita();
            vidaUtilLinterna.instanciarLinternas(0);
            linternita.instanciarLinternita();
            InstanciarSonidosRandoms();
            InstanciarSonidosOutDoorRandoms();
            InstanciasSonidosInDoorRandoms();

            escenario.InstanciarEstructuras();
            monster = new Monster();
            monster.InstanciarMonster(monstruoActual);
            CrearObjetosEnEscenario();
            //iluminables.Add(monster.ghost);
            //iluminables.AddRange(escenario.tgcScene.Meshes);

            TgcMesh mesh1    = escenario.tgcScene.Meshes.Find(mesh => mesh.Name.Equals("linterna_1"));
            TgcMesh mesh2    = escenario.tgcScene.Meshes.Find(mesh => mesh.Name.Equals("linterna_2"));
            var     linterna = new Linterna(mesh1, mesh2, this);

            objetosInteractuables.Add(linterna);

            Camera = personaje;

            quads = new List <FullscreenQuad>();

            //ShadersDir
            effectPosProcesado           = TGCShaders.Instance.LoadEffect(ShadersDir + "PostProcesado.fx");
            effectPosProcesado.Technique = "PostProcessDefault";
            var unQuad = new FullscreenQuad(effectPosProcesado);

            unQuad.loEstoyUsando = true;
            this.quads.Add(unQuad);

            sombras = new Sombras(this);
            sombras.InstanciarSombras();

            this.renderizado = sombras;

            monsterBlur = new MonsterBlur(escenario, this);
            monsterBlur.instanciarMonsterBlur(ShadersDir, monster, MediaDir);
        }
 public Pila(TgcMesh meshAsociado)
 {
     this.mesh         = meshAsociado;
     sonidoInterruptor = new Sonido("Stapler-SoundBible.com-374581609.wav", -3000, false);
 }
 public Sonido(string mediaDir, string shadersDir, TgcDirectSound DS) : base(mediaDir, shadersDir)
 {
     myInstance       = this;
     this.DirectSound = DS;
     Init();
 }
        public Personaje()
        {
            estoyAdentro   = false;
            estoyEscondido = false;
            estoyArriba    = false;

            positionChanged = true;
            rotationChanged = true;

            posicionInicial = new TGCVector3(9500f, 15f, -15000f);
            target          = new TGCVector3(9500f, 15f, -15050f);
            eye             = new TGCVector3(9500f, 15f, -15000f);

            ItemVacioDefault itemDefault = new ItemVacioDefault();

            objetosInteractuables.Add(itemDefault);

            this.itemEnMano = itemDefault;

            var loader = new TgcSceneLoader();
            var scene2 = loader.loadSceneFromFile(MediaDir + "Modelame\\GhostGrande-TgcScene.xml"); //Con demon no funca, aca rompe

            //Solo nos interesa el primer modelo de esta escena (tiene solo uno)
            meshPersonaje = scene2.Meshes[0];

            const float cte = 15f;

            meshPersonaje.Position = new TGCVector3(9500f, 15f, -15000f);
            meshPersonaje.Scale    = new TGCVector3(0f, 0.5f, 0f);
            const int cteY = -570;

            meshPersonaje.BoundingBox = new TgcBoundingAxisAlignBox(new TGCVector3(-20, cteY, -20), new TGCVector3(20, 20, 20));
            meshPersonaje.Transform   = TGCMatrix.Scaling(meshPersonaje.Scale) *
                                        TGCMatrix.RotationYawPitchRoll(meshPersonaje.Rotation.Y, meshPersonaje.Rotation.X, meshPersonaje.Rotation.Z) *
                                        TGCMatrix.Translation(meshPersonaje.Position);



            // \todo: configurable
            float half_box = 4.0f;

            boundingBox = new TgcBoundingAxisAlignBox(
                new TGCVector3(eye.X - half_box, 0.0f, eye.Z - half_box),
                new TGCVector3(eye.X + half_box, eye.Y, eye.Z + half_box));

            vM = TGCMatrix.Identity;

            xAxis       = new TGCVector3();
            yAxis       = new TGCVector3();
            zAxis       = new TGCVector3();
            forward     = new TGCVector3();
            key_left    = 'A';
            key_back    = 'S';
            key_right   = 'D';
            key_forward = 'W';

            absoluteRotationX = 0.0f;
            anguloAbsolutoEnY = 0f;

            MovementSpeed  = 50.0f;
            ForwardFactor  = 1.5f;
            RotationSpeed  = 1.5f;
            MaxTopAngle    = 88.0f;
            MaxBottomAngle = -80.0f;
            CurrentSpeed   = MovementSpeed;

            Control window = D3DDevice.Instance.Device.CreationParameters.FocusWindow;

            windowCenter = window.PointToScreen(
                new Point(window.Width / 2, window.Height / 2));

            lockMouse = false;

            Enable = true;

            setCamera(eye, target);

            //SONIDO

            this.CaminataOutdoorIzq = new Sonido("pisada hierba izda.wav", -5000, false);
            this.CaminataIndoorIzq  = new Sonido("pisada azulejo izda.wav", -5000, false);
            this.CaminataOutdoorDer = new Sonido("pisada hierba dcha.wav", -5000, false);
            this.CaminataIndoorDer  = new Sonido("pisada azulejo dcha.wav", -5000, false);
            sonidoActualDer         = CaminataOutdoorDer;
            sonidoActualIzq         = CaminataOutdoorIzq;
        }