Ejemplo n.º 1
0
        /// <param name="dt">Tiempo desde la última ejecución</param>
        public void UpdatePlane(float dt)
        {
            // Control de saltos en casos de bajo rendimiento y pérdida del foco
            if (dt > 0.1f) dt = 0.1f;

            player.Update(dt);

            // Extraigo los ejes del avion de su matriz transformación
            Vector3 plane = player.GetPosition();
            Vector3 z = player.ZAxis();
            Vector3 y = player.YAxis();
            Vector3 x = player.XAxis();

            GuiController.Instance.UserVars.setValue("Posición en X", plane.X);
            GuiController.Instance.UserVars.setValue("Posición en Y", plane.Y);
            GuiController.Instance.UserVars.setValue("Posición en Z", plane.Z);

            Vector3 camera;
            Vector3 target;

            camera = plane + CAM_DELTA.Y * y + CAM_DELTA.Z * z;
            target = plane + CAM_DELTA.Y * y;
            cam.SetCenterTargetUp(camera, target, y, true);
            cam.updateViewMatrix(d3dDevice);

            if (player.GetPosition().Y >= 18000) {
                mostrar_msj_advertencia = true;
                hora_advertencia = DateTime.Now;
                if (player.GetPosition().Y >= 20000) {
                    motor.stop();
                    motor.closeFile();
                    sound = GuiController.Instance.Mp3Player;
                    sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                    "Jet_Pilot\\Sonido\\Motor_Apagandose.mp3";
                    sound.play(false);
                    reset();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Método que se llama cada vez que hay que refrescar la pantalla.
        /// Escribir aquí todo el código referido al renderizado.
        /// Borrar todo lo que no haga falta
        /// </summary>
        /// <param name="elapsedTime">Tiempo en segundos transcurridos desde el último frame</param>
        /// 
        public override void render(float elapsedTime)
        {
            if (juego_pausado)
            {
                renderMenu();
            }
            else
            {
                if (GuiController.Instance.D3dInput.keyDown(Microsoft.DirectX.DirectInput.Key.P))
                {
                    juego_pausado = true;
                    motor.stop();
                    motor.closeFile();
                }
                else
                {
                    renderTerrainAndClouds(elapsedTime);
                    renderPlane(elapsedTime);
                    updateColision();
                    renderSkybox(elapsedTime);

                    if (sound.getStatus() != TgcMp3Player.States.Playing && motor.getStatus() != TgcMp3Player.States.Playing)
                    {
                        sound.closeFile();
                        motor = GuiController.Instance.Mp3Player;
                        motor.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                        "Jet_Pilot\\Sonido\\avion_3.mp3";
                        motor.play(true);
                    }

                    if (modo_capturar_globos)
                    {
                        render_score();
                        renderGlobos(elapsedTime);
                    }

                    if (mostrar_msj_choque)
                    {
                        if (DateTime.Now.Subtract(hora_choque).Seconds <= 2)
                        {
                            Msj_Choque.render();
                        }
                        else {
                            mostrar_msj_choque = false;
                        }
                    }

                    if (mostrar_msj_triunfo){
                        if (DateTime.Now.Subtract(hora_trunfo).Seconds <= 2)
                        {
                            Msj_Triunfo.render();
                        }
                        else {
                            mostrar_msj_triunfo = false;
                        }
                    }

                    if (mostrar_msj_advertencia){

                        if (DateTime.Now.Subtract(hora_advertencia).Seconds <= 2)
                        {
                            Msj_Advertencia.render();
                        }
                        else {
                            mostrar_msj_advertencia = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void renderGlobos(float elapsedTime)
        {
            /*Envía los Globos a renderizar*/

            Vector3 centro_globo;
            Vector3 centro_avion = player.Get_Center();
            Vector3 vector_centros;

            int i = 0;

            foreach (Vector3 pos in objetivos)
            {
                Globo.Position = pos;

                if (pos.Length() != 0)
                {

                    centro_globo = Globo.BoundingBox.calculateBoxCenter();

                    vector_centros = centro_globo - centro_avion;

                    if (vector_centros.Length() <= (player.Get_Radius() + Globo.BoundingBox.calculateBoxRadius())) //Verifico si colisiona el globo con el avión
                    {
                        quitarGlobo(i);
                        Score = Score + 1;
                        motor.stop();
                        motor.closeFile();
                        sound = GuiController.Instance.Mp3Player;
                        sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                        "Jet_Pilot\\Sonido\\Sonido_Captura1.mp3";
                        sound.play(false);

                        if (Score == cantidad_globos)
                        { //Si completé el nivel debo mostrar msj de felicitaciones
                            hora_trunfo = DateTime.Now;
                            mostrar_msj_triunfo = true;
                            //sound = GuiController.Instance.Mp3Player;
                            sound.closeFile();
                            sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                            "Jet_Pilot\\Sonido\\Musica_Victoria.mp3";
                            sound.play(false);
                            Score = 0;
                        }

                    }
                    else //No colisiona, entonces lo dibujo
                    {
                        if (BBGlobos)
                        {
                            Globo.BoundingBox.render();
                        }
                        Globo.render();
                    }
                }

                i += 1;
            }
        }
Ejemplo n.º 4
0
 private void updateColision()
 {
     //hago colisionar el avion
     if (colisionador.colisionar(player.getMesh().BoundingBox, centros_terrains_colisionables))
     {
         mostrar_msj_choque = true;
         hora_choque = DateTime.Now;
         motor.stop();
         motor.closeFile();
         sound = GuiController.Instance.Mp3Player;
         sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
         "Jet_Pilot\\Sonido\\Motor_Apagandose.mp3";
         sound.play(false);
         reset();
     }
 }
Ejemplo n.º 5
0
        private void renderMenu()
        {
            GuiController.Instance.Drawer2D.beginDrawSprite();
            Imagen_Menu.render();
            GuiController.Instance.Drawer2D.endDrawSprite();
            Texto_Start.render();
            Texto_Titulo.render();

            if (sound.getStatus() != TgcMp3Player.States.Playing)
            {
                sound = GuiController.Instance.Mp3Player;
                sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                "Jet_Pilot\\Sonido\\102_prologue.mp3";
                sound.play(true);
            }

            if (GuiController.Instance.D3dInput.keyDown(Microsoft.DirectX.DirectInput.Key.Return))
            {
                juego_pausado = false;
                sound.stop();
                sound.closeFile();
                motor = GuiController.Instance.Mp3Player;
                motor.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
                "Jet_Pilot\\Sonido\\avion_3.mp3";
                motor.play(true);
                juego_iniciado = true;
            }

            if (juego_iniciado)
            {
                Texto_Start.Text = "Presione enter para reanudar";
                if (modo_capturar_globos)
                {
                    render_score();
                }
            }
        }
Ejemplo n.º 6
0
        //Metodos para el menú y el marcador
        private void initMenu()
        {
            Imagen_Menu = new TgcSprite();
            Imagen_Menu.Texture =
            TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir +
                                     "Jet_Pilot\\Menu\\JP4.jpg");

            float factor_ancho = (float)anchoPantalla / (float)Imagen_Menu.Texture.Width;
            float factor_alto = (float)altoPantalla / (float)Imagen_Menu.Texture.Height;
            Imagen_Menu.Position = new Vector2(0, 0);
            Imagen_Menu.Scaling = new Vector2(factor_ancho, factor_alto);

            Texto_Start = new TgcText2d();
            Texto_Titulo = new TgcText2d();

            Texto_Start.Color = Color.Green;
            Texto_Titulo.Color = Color.LightGray;

            Texto_Start.Text = "Presione enter para iniciar";
            Texto_Titulo.Text = "JET PILOT";

            Texto_Start.changeFont(new System.Drawing.Font("Cataclysmic", 25.0f));
            Texto_Titulo.changeFont(new System.Drawing.Font("Chiller", 50.0f));

            Texto_Start.Size = new Size(0, 0);
            Texto_Titulo.Size = new Size(0, 0);

            Texto_Start.Position = new Point(anchoPantalla / 2 + Texto_Start.Text.Length / 2, altoPantalla * 9 / 10);
            Texto_Titulo.Position = new Point(anchoPantalla / 6, 0);

            sound = GuiController.Instance.Mp3Player;
            sound.FileName = GuiController.Instance.AlumnoEjemplosMediaDir +
            "Jet_Pilot\\Sonido\\102_prologue.mp3";
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Crea todos los modulos necesarios de la aplicacion
        /// </summary>
        internal void initGraphics(MainForm mainForm, Control panel3d)
        {
            this.mainForm = mainForm;
            this.panel3d = panel3d;
            this.fullScreenPanel = new FullScreenPanel();
            panel3d.Focus();

            //Iniciar graficos
            this.tgcD3dDevice = new TgcD3dDevice(panel3d);
            this.texturesManager = new TgcTexture.Manager();
            this.tgcD3dDevice.OnResetDevice(tgcD3dDevice.D3dDevice, null);

            //Iniciar otras herramientas
            this.texturesPool = new TgcTexture.Pool();
            this.logger = new Logger(mainForm.LogConsole);
            this.text3d = new TgcDrawText(tgcD3dDevice.D3dDevice);
            this.tgcD3dInput = new TgcD3dInput(mainForm, panel3d);
            this.fpsCamera = new TgcFpsCamera();
            this.rotCamera = new TgcRotationalCamera();
            this.thirdPersonCamera = new TgcThirdPersonCamera();
            this.axisLines = new TgcAxisLines(tgcD3dDevice.D3dDevice);
            this.userVars = new TgcUserVars(mainForm.getDataGridUserVars());
            this.modifiers = new TgcModifiers(mainForm.getModifiersPanel());
            this.elapsedTime = -1;
            this.frustum = new TgcFrustum();
            this.mp3Player = new TgcMp3Player();
            this.directSound = new TgcDirectSound();
            this.fog = new TgcFog();
            this.currentCamera = this.rotCamera;
            this.customRenderEnabled = false;
            this.drawer2D = new TgcDrawer2D();
            this.shaders = new TgcShaders();

            //toogles
            this.rotCamera.Enable = true;
            this.fpsCamera.Enable = false;
            this.thirdPersonCamera.Enable = false;
            this.fpsCounterEnable = true;
            this.axisLines.Enable = true;

            //Cargar algoritmos
            exampleLoader = new ExampleLoader();
            examplesDir = System.Environment.CurrentDirectory + "\\" + ExampleLoader.EXAMPLES_DIR + "\\";
            examplesMediaDir = examplesDir + "Media" + "\\";
            alumnoEjemplosDir = System.Environment.CurrentDirectory + "\\" + "AlumnoEjemplos" + "\\";
            alumnoEjemplosMediaDir = alumnoEjemplosDir + "AlumnoMedia" + "\\";
            exampleLoader.loadExamplesInGui(mainForm.TreeViewExamples, new string[] { examplesDir, alumnoEjemplosDir });

            //Cargar shaders del framework
            this.shaders.loadCommonShaders();

            //Cargar ejemplo default
            TgcExample defaultExample = exampleLoader.getExampleByName(mainForm.Config.defaultExampleName, mainForm.Config.defaultExampleCategory);
            executeExample(defaultExample);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Método que se llama una sola vez,  al principio cuando se ejecuta el ejemplo.
        /// Escribir aquí todo el código de inicialización: cargar modelos, texturas, modifiers, uservars, etc.
        /// Borrar todo lo que no haga falta
        /// </summary>
        public override void init()
        {
            //GuiController.Instance: acceso principal a todas las herramientas del Framework

            //Device de DirectX para crear primitivas
            d3dDevice = GuiController.Instance.D3dDevice;

            rand = new Random();

            //Carpeta de archivos Media del alumno
            alumnoMediaFolder = GuiController.Instance.AlumnoEjemplosMediaDir;

            effect = TgcShaders.loadEffect(alumnoMediaFolder + "Shaders\\viento.fx");

            Control focusWindows = GuiController.Instance.D3dDevice.CreationParameters.FocusWindow;
            mouseCenter = focusWindows.PointToScreen(
                new Point(
                    focusWindows.Width / 2,
                    focusWindows.Height / 2)
                    );

            inicializarTerreno();

            pathMusica = GuiController.Instance.AlumnoEjemplosMediaDir + "Sonidos\\Stayin_alive.mp3";
            GuiController.Instance.Mp3Player.closeFile();
            GuiController.Instance.Mp3Player.FileName = pathMusica;

            player = GuiController.Instance.Mp3Player;

            //player.play(true);

            //Crear Sprite
            mira = new TgcSprite();
            mira.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\mira.png");
            miraActivada = false;
            mira_zoom = new TgcSprite();
            mira_zoom.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\mira_zoom3.png");

            arma = new TgcSprite();
            arma.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\arma.png");

            fuegoArma = new TgcAnimatedSprite(
                GuiController.Instance.ExamplesMediaDir + "\\Texturas\\Sprites\\Explosion.png", //Textura de 256x256
                new Size(64, 64), //Tamaño de un frame (64x64px en este caso)
                16, //Cantidad de frames, (son 16 de 64x64px)
                10 //Velocidad de animacion, en cuadros x segundo
                );

            //Sonidos
            disparo = new TgcStaticSound();
            disparo.loadSound(alumnoMediaFolder + "\\Sonidos\\disparo.wav");

            headshot = new TgcStaticSound();
            headshot.loadSound(alumnoMediaFolder + "\\Sonidos\\Headshot.wav");

            golpe = new TgcStaticSound();
            golpe.loadSound(alumnoMediaFolder + "\\Sonidos\\punch.wav");

            explosion = new TgcStaticSound();
            explosion.loadSound(alumnoMediaFolder + "\\Sonidos\\explosion.wav");

            muerte = new TgcStaticSound();
            muerte.loadSound(alumnoMediaFolder + "\\Sonidos\\gameover.wav");

            ganador = new TgcStaticSound();
            ganador.loadSound(alumnoMediaFolder + "\\Sonidos\\ganador.wav");

            sorpresa = new TgcStaticSound();
            sorpresa.loadSound(alumnoMediaFolder + "\\Sonidos\\sorpresa.wav");

            //Ubicarlo centrado en la pantalla
            screenSize = GuiController.Instance.Panel3d.Size;
            Size textureSize = mira.Texture.Size;
            mira.Scaling = new Vector2(0.6f, 0.6f);
            mira.Position = new Vector2(FastMath.Max(screenSize.Width / 2 - (textureSize.Width * 0.6f) / 2, 0), FastMath.Max(screenSize.Height / 2 - (textureSize.Height * 0.6f) / 2, 0));

            mira_zoom.Scaling = new Vector2((float)screenSize.Width / mira_zoom.Texture.Size.Width, (float)screenSize.Height / mira_zoom.Texture.Size.Height);
            mira_zoom.Position = new Vector2(0, 0);

            Size armaSize = arma.Texture.Size;
            float escalaAncho = (screenSize.Width / 2f) / armaSize.Width;

            arma.Scaling = new Vector2(escalaAncho, escalaAncho);
            arma.Position = new Vector2(screenSize.Width - (armaSize.Width * escalaAncho), screenSize.Height - (armaSize.Height * escalaAncho));

            posicionArmaDisparo = new Vector2(arma.Position.X + 5f, arma.Position.Y + 5f);
            posicionArmaOriginal = arma.Position;

            fuegoArma.Position = arma.Position + new Vector2(22f,28f);

            inicializarArboles();
            inicializarPasto();
            inicializarPiedras();

            totales = new List<TgcMesh>();
            totales.AddRange(arboles);
            totales.AddRange(pasto);
            totales.AddRange(piedras);

            qt = new Quadtree();
            qt.create(totales, bbSkyBox);
            qt.createDebugQuadtreeMeshes();

            //Crear texto vida, básico
            vida = new TgcText2d();
            vida.Text = "100";
            vida.Color = Color.White;
            vida.Size = new Size(300, 100);
            vida.changeFont(new System.Drawing.Font("BankGothic Md BT", 25, FontStyle.Bold));
            vida.Position = new Point(-60, 0);

            barraVida = new TgcSprite();
            barraVida.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\barra_vida.png");
            barraVida.Position = new Vector2((float)vida.Position.X + 175f, (float)vida.Position.Y);
            barraVida.Scaling = new Vector2(0.3f, 0.3f);

            textoPuntaje = new TgcText2d();
            textoPuntaje.Text = "Puntos: 0";
            textoPuntaje.Color = Color.White;
            textoPuntaje.Size = new Size(300, 100);
            textoPuntaje.changeFont(new System.Drawing.Font("BankGothic Md BT", 25, FontStyle.Bold));
            textoPuntaje.Position = new Point(screenSize.Width - 300, 0);

            TgcSceneLoader loaderLogo = new TgcSceneLoader();
            logoTgc = loaderLogo.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\LogoTGC\\LogoTGC-TgcScene.xml").Meshes[0];
            logoTgc.move(new Vector3(0f, 1900f, 0f));
            logoTgc.Scale = new Vector3(14f, 14f, 14f);

            //Cargar Shader de PhongShading
            logoTgc.Effect = GuiController.Instance.Shaders.TgcMeshPhongShader;
            logoTgc.Technique = GuiController.Instance.Shaders.getTgcMeshTechnique(logoTgc.RenderType);
            //Cargar variables shader
            logoTgc.Effect.SetValue("ambientColor", ColorValue.FromColor(Color.Gray));
            logoTgc.Effect.SetValue("diffuseColor", ColorValue.FromColor(Color.LightBlue));
            logoTgc.Effect.SetValue("specularColor", ColorValue.FromColor(Color.White));
            logoTgc.Effect.SetValue("specularExp", 20f);
            logoTgc.Effect.SetValue("lightPosition", lightPos);
            reproducirSorpresa = false;

            //////VARIABLES DE FRUSTUM

            aspectRatio = (float)GuiController.Instance.Panel3d.Width / GuiController.Instance.Panel3d.Height;

            ruedita = 0f;

            //Inicializo angulo de FOV
            anguloFov = FastMath.ToRad(45.0f);

            GuiController.Instance.D3dDevice.Transform.Projection = Matrix.PerspectiveFovLH(anguloFov, aspectRatio, 1f, 50000f);

            ///////////////USER VARS//////////////////
            /*
            //Crear una UserVar
            GuiController.Instance.UserVars.addVar("variablePrueba");

            //Cargar valor en UserVar
            GuiController.Instance.UserVars.setValue("variablePrueba", 5451);
            */

            ///////////////MODIFIERS//////////////////

               /*
            //Crear un modifier para un valor FLOAT
            GuiController.Instance.Modifiers.addFloat("valorFloat", -50f, 200f, 0f);

            //Crear un modifier para un ComboBox con opciones
            string[] opciones = new string[] { "opcion1", "opcion2", "opcion3" };
            GuiController.Instance.Modifiers.addInterval("valorIntervalo", opciones, 0);

            //Crear un modifier para modificar un vértice
            GuiController.Instance.Modifiers.addVertex3f("valorVertice", new Vector3(-100, -100, -100), new Vector3(50, 50, 50), new Vector3(0, 0, 0));
            */

            ///////////////CONFIGURAR CAMARA ROTACIONAL//////////////////
            //Es la camara que viene por default, asi que no hace falta hacerlo siempre
            //GuiController.Instance.RotCamera.Enable = true;
            //Configurar centro al que se mira y distancia desde la que se mira
            //GuiController.Instance.RotCamera.setCamera(new Vector3(0, 0, 0), 300);
            Vector3 posicion = new Vector3(0f, 150f, 0f);
            /*GuiController.Instance.FpsCamera.Enable = true;
            GuiController.Instance.FpsCamera.setCamera(new Vector3(0,120,0), new Vector3(1, 0, 1));
            //GuiController.Instance.FpsCamera.LookAt(new Vector3(0,120,0));
            GuiController.Instance.FpsCamera.JumpSpeed = 0;
            GuiController.Instance.FpsCamera.MovementSpeed *= 10;*/

            GuiController.Instance.FpsCamera.Enable = false;
            GuiController.Instance.RotCamera.Enable = false;

            camaraQ3 = new Q3FpsCamera();
            camaraQ3.setCamera(posicion, posicion + new Vector3(1.0f, 0.0f, 0.0f));
            camaraQ3.RotationSpeed = velocidadAngular;
            camaraQ3.MovementSpeed = velocidadMov;
            camaraQ3.LockCam = false;

            ultimaPosCamara = camaraQ3.getPosition();
            Vector3 posBound = new Vector3(camaraQ3.getPosition().X, camaraQ3.getPosition().Y + 30, camaraQ3.getPosition().Z);
            boundingCamara = new TgcBoundingBox();
            boundingCamScale = new Vector3(1f, 1f, 1f);
            boundingCamara.scaleTranslate(posBound, boundingCamScale);

            personaje = TgcBox.fromSize(new Vector3(30f, 60f, 30f), Color.Red);
            personaje.Position = camaraQ3.getPosition();
            personaje.move(new Vector3(0f, -30f, 0f));

            //ENEMIGOS
            instanciasEnemigos = new List<Enemigo>();
            //El ultimo parametro es el radio
            inicializarEnemigos(4, 4, instanciasEnemigos, 3.4f, 200.0f);

            crearEsferaExplosion();
            inicializarBarriles();

            //Para disparo
            col = new Vector3(0f, 0f, 0f);
            huboDisparo = false;
            disparoBarril = false;
            unaBala = new Bala();
            puntoDisparo = TgcBox.fromSize(new Vector3(10f, 10f, 10f), Color.Red);

            #region menu
            //Defino el estado inicial como menu
            estadoJuego = estado.menu;

            //Sprites para menu
            fondoMenu = new TgcSprite();
            fondoMenu.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\fondo_menu.jpg");

            titulo = new TgcSprite();
            titulo.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\titulo.png");
            titulo.Scaling = new Vector2(0.5f, 0.5f);
            titulo.Position = new Vector2((screenSize.Width / 2) - titulo.Texture.Width / 4, (titulo.Texture.Height / 2)-50f);

            instrucciones = new TgcSprite();
            instrucciones.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\instrucciones.png");
            instrucciones.Scaling = new Vector2(0.4f, 0.5f);
            instrucciones.Position = new Vector2((screenSize.Width / 2) - (instrucciones.Texture.Width*0.4f) / 2, (instrucciones.Texture.Height / 2) - instrucciones.Texture.Height / 2);

            creditos = new TgcSprite();
            creditos.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\creditos.png");
            creditos.Scaling = new Vector2(0.5f, 0.5f);
            creditos.Position = new Vector2((screenSize.Width / 2) - creditos.Texture.Width / 4, (creditos.Texture.Height / 2) - creditos.Texture.Height / 2);

            botonJugar = new TgcSprite();
            botonJugar.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\boton_jugar.png");
            botonJugar.Scaling = new Vector2(0.5f, 0.5f);
            sizeJugar = botonJugar.Texture.Size;
               // sizeJugar.Width = sizeJugar.Width / 2;
            botonJugar.Position = new Vector2((screenSize.Width / 2)-sizeJugar.Width/4, (screenSize.Height / 2)-sizeJugar.Height/4);

            botonInstrucciones = new TgcSprite();
            botonInstrucciones.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\boton_instrucciones.png");
            botonInstrucciones.Scaling = new Vector2(0.5f, 0.5f);
            sizeInstrucciones = botonInstrucciones.Texture.Size;
            //sizeInstrucciones.Width = sizeInstrucciones.Width / 2;
            botonInstrucciones.Position = new Vector2((screenSize.Width / 2) - sizeInstrucciones.Width / 4, (screenSize.Height / 2) - sizeInstrucciones.Height / 4 + 85f);

            botonCreditos = new TgcSprite();
            botonCreditos.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\Menu\\boton_creditos.png");
            botonCreditos.Scaling = new Vector2(0.5f, 0.5f);
            sizeCreditos = botonCreditos.Texture.Size;
            //sizeCreditos.Width = sizeCreditos.Width / 2;
            botonCreditos.Position = new Vector2((screenSize.Width / 2) - sizeCreditos.Width / 4, (screenSize.Height / 2) - sizeCreditos.Height / 4 + sizeInstrucciones.Height + 50f);

            textoPerdiste = new TgcText2d();
            textoPerdiste.Text = "Game over";
            textoPerdiste.Align = TgcText2d.TextAlign.CENTER;
            textoPerdiste.Color = Color.Black;
            textoPerdiste.Size = new Size(600, 100);
            textoPerdiste.Position = new Point((screenSize.Width / 2) - textoPerdiste.Size.Width / 2, (screenSize.Height / 2) - textoPerdiste.Size.Height / 2);
            textoPerdiste.changeFont(new System.Drawing.Font("BankGothic Md BT", 50, FontStyle.Bold));

            textoGanaste = new TgcText2d();
            textoGanaste.Text = "Ganaste!";
            textoGanaste.Align = TgcText2d.TextAlign.CENTER;
            textoGanaste.Color = Color.Black;
            textoGanaste.Size = new Size(600, 100);
            textoGanaste.Position = new Point((screenSize.Width / 2) - textoGanaste.Size.Width / 2, (screenSize.Height / 2) - textoGanaste.Size.Height / 2);
            textoGanaste.changeFont(new System.Drawing.Font("BankGothic Md BT", 50, FontStyle.Bold));

            textoPuntajeFinal = new TgcText2d();
            textoPuntajeFinal.Color = Color.Black;
            textoPuntajeFinal.changeFont(new System.Drawing.Font("BankGothic Md BT", 25, FontStyle.Bold));
            textoPuntajeFinal.Size = new Size(800, 100);
            textoPuntajeFinal.Position = new Point((screenSize.Width / 2) - textoPuntajeFinal.Size.Width / 2, (screenSize.Height / 2) - textoPuntajeFinal.Size.Height/2 + textoGanaste.Size.Height);

            textoPuntajeRecord = new TgcText2d();
            textoPuntajeRecord.Color = Color.Black;
            textoPuntajeRecord.Size = new Size(400, 60);
            textoPuntajeRecord.changeFont(new System.Drawing.Font("BankGothic Md BT", 15, FontStyle.Bold));
            textoPuntajeRecord.Position = new Point((screenSize.Width - textoPuntajeRecord.Size.Width),(screenSize.Height-textoPuntajeRecord.Size.Height/2));
            puntajeRecord = Int32.Parse(System.IO.File.ReadAllText(alumnoMediaFolder + "\\record.txt"));
            textoPuntajeRecord.Text = "Tu puntaje record es: " + puntajeRecord.ToString();

            primeraVez = true;
            #endregion menu
        }