Пример #1
0
 public Nave(string mediaDir, TGCVector3 posicionInicial, InputDelJugador input)
 {
     this.mediaDir              = mediaDir;
     this.modeloNave            = new ModeloCompuesto(mediaDir + "XWing\\X-Wing-TgcScene.xml", posicion);
     this.posicion              = posicionInicial;
     this.input                 = input;
     this.velocidadBase         = 5f;
     this.velocidadActual       = velocidadBase;
     this.aceleracionMovimiento = 0.01f;
     this.rotacionBase          = new TGCVector3(0f, Geometry.DegreeToRadian(180f), 0f);
     this.rotacionActual        = rotacionBase;
     this.velocidadRotacion     = 0.008f;
     this.estaRolleando         = false;
     this.estaVivo              = true;
     this.ultimoRoll            = new DateTime(0);
 }
Пример #2
0
        public override void Init()
        {
            //Scene = new TgcSceneLoader().loadSceneFromFile(MediaDir + "Xwing\\TRENCH_RUN-TgcScene.xml");

            /*
             * Bloque bloque = new Bloque(MediaDir, new TGCVector3(0f,0f,1000f), "Xwing\\TRENCH_RUN-TgcScene.xml");
             * GameManager.Instance.AgregarRenderizable(bloque);
             *
             * Bloque bloque1 = new Bloque(MediaDir, new TGCVector3(0f, 100f, 3000f), "Xwing\\death+star-TgcScene.xml");
             * Bloque bloque2 = new Bloque(MediaDir, new TGCVector3(0f, 0f, 5000f), "Xwing\\TRENCH_RUN-TgcScene.xml");
             * GameManager.Instance.AgregarRenderizable(bloque1);
             * GameManager.Instance.AgregarRenderizable(bloque2);
             */
            var posicionInicialDeNave = new TGCVector3(100, -15, -250);

            InputDelJugador input = new InputDelJugador(Input);

            Nave naveDelJuego = new Nave(MediaDir, posicionInicialDeNave, input);

            GameManager.Instance.AgregarRenderizable(naveDelJuego);

            Camara camaraDelJuego = new Camara(posicionInicialDeNave, 10, -50, naveDelJuego);

            Camera = camaraDelJuego;
            GameManager.Instance.Camara = camaraDelJuego;

            escenarioLoader = new EscenarioLoader(MediaDir, naveDelJuego);
            //Skybox skybox = new Skybox(MediaDir, camaraDelJuego);
            //GameManager.Instance.AgregarRenderizable(skybox);

            /*
             * Torreta torreta = new Torreta(MediaDir, new TGCVector3(10,2, 15), naveDelJuego);
             * GameManager.Instance.AgregarRenderizable(torreta);
             *
             * Torreta torreta2 = new Torreta(MediaDir, new TGCVector3(-10, 2, 15), naveDelJuego);
             * GameManager.Instance.AgregarRenderizable(torreta2);
             *
             * TGCVector3 direccionDisparo = posicionInicialDeNave - new TGCVector3(10, 2, 15);
             * torreta.Disparar(direccionDisparo);
             * torreta2.Disparar(posicionInicialDeNave - new TGCVector3(-10, 2, 15));
             */
        }