private ContadorBalas()
        {
            Size screenSize = GuiController.Instance.Panel3d.Size;
            juego = Juego.Instance;

            indicadorBala = new Indicadores();
            indicadorCargador = new Indicadores();

            texto = new TgcText2d();
            texto.Color = Color.Red;
            texto.Align = TgcText2d.TextAlign.LEFT;

            int tamañoTexturaBala = (int)indicadorBala.getPosicionXSpriteBala();
            texto.Position = new Point(tamañoTexturaBala + 25, screenSize.Height - 32);
            texto.Size = new Size(350, 500);
            texto.changeFont(new System.Drawing.Font("Arial", 16f, FontStyle.Bold));

            textoCargador = new TgcText2d();
            textoCargador.Color = Color.Red;
            textoCargador.Align = TgcText2d.TextAlign.LEFT;

            int tamañoTexturaCargador = (int)indicadorBala.getPosicionXSpriteCargador();
            textoCargador.Position = new Point(tamañoTexturaCargador + 190, screenSize.Height - 32);
            textoCargador.Size = new Size(350, 100);
            textoCargador.changeFont(new System.Drawing.Font("Arial", 16f, FontStyle.Bold));

            setInitialValues();
        }
Exemple #2
0
        public GameOver()
        {
            indacadorGameOver = new Indicadores();

            textoFin = new TgcText2d();
            textoFin.Color = Color.Black;
            textoFin.Align = TgcText2d.TextAlign.CENTER;
            textoFin.Position = new Point(0, 0);
            textoFin.Size = new Size(650, 300);
            textoFin.changeFont(new System.Drawing.Font("Arial", 16f, FontStyle.Bold));
            textoFin.Text = "GAME OVER!!";

            //cargo el sprite del gameover

            spriteGameOver = new TgcSprite();
            spriteGameOver.Texture = TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "\\RenderMan\\sprites\\Game-Over.png");
            Size textureSize = spriteGameOver.Texture.Size;
            spriteGameOver.Scaling = new Vector2(indacadorGameOver.ajustarTexturaAPantalla(screenSize.Width, textureSize.Width),indacadorGameOver.ajustarTexturaAPantalla(screenSize.Height, textureSize.Height));
            spriteGameOver.Position = new Vector2(0, 0);
            //sonido.playSonidoFin();
        }
        public override void init()
        {
            GuiController.Instance.Modifiers.addFloat("zoom", 2f, 5f, 3f);
            GuiController.Instance.Modifiers.addBoolean("huellas", "Mostrar huellas", true);
            GuiController.Instance.Modifiers.addBoolean("nieve", "Mostrar nieve", true);

            Device d3dDevice = GuiController.Instance.D3dDevice;

            juego = Juego.getInstance();
            vida = Vida.getInstance();
            vida.initialize();

            //ppManager = new PostProcesadoManager(this);

            camara = new TgcFpsMiCamara();
            camara.Enable = true;
            camara.setCamera(new Vector3(-200, 40, 0), new Vector3(0, 10, 0));
            camara.MovementSpeed = 150;

            soundManager = SoundManager.getInstance();
            contadorBalas = ContadorBalas.getInstance();
            escenarioManager = new EscenarioManager();

            escenarioManager.generarPosiciones();
            escenarioManager.generarBosque(500, 200, 40);

            octree = new Octree();
            octree.create(escenarioManager.getOptimizables(), escenarioManager.limites);
            octree.createDebugOctreeMeshes();

            enemigosManager = new EnemigosManager(escenarioManager);
            enemigosManager.generarEnemigos(Juego.Instance.totalEnemigos);

            Juego.Instance.manejoEnemigos(enemigosManager);

            contadorEnemigos = new ContadorEnemigos();

            armaManager = ArmaManager.getInstance(enemigosManager, camara, escenarioManager);

            indicadores = new Indicadores();

            camara.setEscenarioManger(escenarioManager);

            finalJuego = new GameOver();

            huellaManager = new HuellasManager(25);

            nieve = new Nieve(3000, 3000, 200);
            clima = new Clima(nieve, soundManager);
        }