예제 #1
0
        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);
        }
예제 #2
0
 /// <summary>
 ///     Acciones correspondientes al render
 /// </summary>
 public void render()
 {
     SkyBox.render();
     Floor.render();
     quad.render(CameraFrustum, false);
 }