public void renderSinEmpezar(EjemploAlumno juego) { render(juego); textoComplementario.render(); jugar(juego); }
public void renderGanado(EjemploAlumno juego) { titulo.Text = "¡GANASTE!"; sombra.Text = "¡GANASTE!"; render(juego); }
private void jugar(EjemploAlumno juego) { if (input.buttonDown(TgcD3dInput.MouseButtons.BUTTON_LEFT)) { juego.estado = EstadoDelJuego.Jugando; } }
public void renderPerdido(EjemploAlumno juego) { titulo.Text = "¡PERDISTE!"; sombra.Text = "¡PERDISTE!"; render(juego); }
public void render(EjemploAlumno juego) { GuiController.Instance.Drawer2D.beginDrawSprite(); fondo.render(); GuiController.Instance.Drawer2D.endDrawSprite(); sombra.render(); titulo.render(); }
public void renderInstrucciones(EjemploAlumno juego) { titulo.Text = "INSTRUCCIONES"; sombra.Text = "INSTRUCCIONES"; textoComplementario.Position = new Point(230, 250); textoComplementario.Size = new Size(700, 100); textoComplementario.Text = "Dispararle al barco enemigo [SPACE] hasta hundirlo. Con las flechitas RIGHT y LEFT vira el barco. Con UP se acelera y DOWN desacelera." + '\n' + "Con A se activa la visibilidad del ángulo de elevación del disparo, y con W y S se incrementa o decrementa dicho ángulo." + '\n' + "Con L se activa la tormenta." + '\n' + '\n' + "Hacé clic para continuar."; render(juego); textoComplementario.render(); jugar(juego); }
/// <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() { EjemploAlumno.Instance = this; //GuiController.Instance: acceso principal a todas las herramientas del Framework //Device de DirectX para crear primitivas Device d3dDevice = GuiController.Instance.D3dDevice; //Carpeta de archivos Media del alumno string alumnoMediaFolder = GuiController.Instance.AlumnoEjemplosMediaDir; //Terreno currentHeightmap = GuiController.Instance.AlumnoEjemplosMediaDir + "Heightmap3.jpg"; currentTexture = GuiController.Instance.AlumnoEjemplosMediaDir + "TerrainTexture3.jpg"; terrain = new TerrenoSimple(); terrain.loadHeightmap(currentHeightmap, currentScaleXZ, currentScaleY, new Vector3(0, -125, 0)); terrain.loadTexture(currentTexture); //Agua agua = new TerrenoSimple(); agua.loadHeightmap(GuiController.Instance.AlumnoEjemplosMediaDir + "18_vertex_texture_02.jpg", 50f, 0.5f, new Vector3(0, -125, 0)); agua.loadTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "4141-diffuse.jpg"); agua.AlphaBlendEnable = true; //heightOlas = agua.heightOlas; //Modifier GuiController.Instance.Modifiers.addFloat("heightOlas", 10, 50, 40); //Estado EjemploAlumno.Instance.estado = EstadoDelJuego.SinEmpezar; menu = new Menu(); // Crear SkyBox: skyBox = new TgcSkyBox(); skyBox.Center = new Vector3(0, 0, 0); skyBox.Size = new Vector3(12000, 12000, 12000); skyboxSoleado(skyBox); skyBoundingBox = new TgcBox(); skyBoundingBox.Size = skyBox.Size; skyBoundingBox.Position = skyBox.Center; skyBoundingBox.AlphaBlendEnable = true; skyBoundingBox.updateValues(); lloviendo = false; //Cargar meshes TgcViewer.Utils.TgcSceneLoader.TgcSceneLoader loader = new TgcViewer.Utils.TgcSceneLoader.TgcSceneLoader(); TgcViewer.Utils.TgcSceneLoader.TgcScene scene = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Vehiculos\\Canoa\\Canoa-TgcScene.xml"); meshShip = scene.Meshes[0]; meshShip.setColor(Color.Chocolate); scene = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Vehiculos\\Canoa\\Canoa-TgcScene.xml"); meshes.Add(meshShip); meshShipContrincante = scene.Meshes[0]; meshShipContrincante.setColor(Color.BlueViolet); meshes.Add(meshShipContrincante); scene = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Armas\\Canon\\Canon.max-TgcScene.xml"); meshCanion = scene.Meshes[0]; meshes.Add(meshCanion); scene = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Armas\\Canon\\Canon.max-TgcScene.xml"); meshCanionContrincante = scene.Meshes[0]; meshes.Add(meshCanionContrincante); //Shader effect = TgcShaders.loadEffect(alumnoMediaFolder + "shader agua.fx"); agua.Effect = effect; agua.Technique = "RenderScene"; time = 0; agua.AlphaBlendEnable = true; efectoSombra = TgcShaders.loadEffect(alumnoMediaFolder + "shader agua.fx"); //Creaciones ship = new Ship(POS_SHIP, meshShip, new Canion(POS_SHIP, 5, meshCanion, true)); shipContrincante = new EnemyShip(ship, POS_CONTRINCANTE, meshShipContrincante, new Canion(POS_CONTRINCANTE, 5, meshCanionContrincante, false)); mainCamera = new MainCamera(ship); //Crear caja para indicar ubicacion de la luz lightMesh = TgcBox.fromSize(new Vector3(20, 20, 20), Color.Yellow); }