Ejemplo n.º 1
0
        public static void TelaPrincipal()
        {
            V.img[0].TextureRect = new IntRect(0, 0, 300, 375);
            V.img[0].Texture     = logo;
            V.img[0].Position    = new Vector2f(Screen.width / 2 - 150, Screen.height / 2 - 187);
            V.window.Draw(V.img[0]);

            if (Efeitos.opacidade <= 0 && !F.TeclaDesativada("delay") && !delay)
            {
                delay = true;
                F.DesativarTecla("delay", 750);
            }

            if (Efeitos.opacidade <= 0 && !F.TeclaDesativada("delay") && delay)
            {
                Efeitos.Backdrop("fade-in", 255, 2.5f);
            }

            if (Efeitos.opacidade >= 255 && delay)
            {
                CurrentScreen.Change("mainmenu");
            }

            if (F.Key("space"))
            {
                Efeitos.opacidade = 255;
                CurrentScreen.Change("mainmenu");
                F.DesativarTecla("space", 500);
            }
        }
Ejemplo n.º 2
0
        public static void LocalMapDraw()
        {
            V.window.SetView(V.view);

            foreach (Chao x in V.chao.ToList())
            {
                x.Draw();
            }

            foreach (Limite x in V.limites.ToList())
            {
                x.Draw();
            }

            V.objetos.Sort((x, y) => x.zindex.CompareTo(y.zindex));
            foreach (Geral x in V.objetos.ToList())
            {
                x.Draw();
            }

            V.window.SetView(V.hud);

            foreach (TempText x in V.temptexts.ToList())
            {
                x.Draw();
            }

            Efeitos.BackdropRun();
        }
Ejemplo n.º 3
0
        public static void DrawHUD()
        {
            V.window.SetView(V.hud);

            if (V.backdrop)
            {
                Efeitos.BackdropRun();
            }
        }
Ejemplo n.º 4
0
        public override void OnStart()
        {
            Idk.windowColor   = new Color(53, 74, 95);
            Screen.width      = 800;
            Screen.height     = 600;
            V.window.Position = new Vector2i((int)(VideoMode.DesktopMode.Width / 2) - (int)(Screen.width / 2), (int)(VideoMode.DesktopMode.Height / 2) - (int)(Screen.height / 2) - 30);

            logo = new Texture("res/logo.png");

            Efeitos.opacidade = 255;
            Efeitos.Backdrop("fade-out", 0, 2.5f);
        }
Ejemplo n.º 5
0
 public static void Draw()
 {
     Efeitos.AjustarCamera(camera);
     if (!controle.pausado)
     {
         F.MovePersonagem(controle);
     }
     if (controle.vidaA <= 0)
     {
         controle.gameOver = Efeitos.GameOver(controle);
     }
 }
Ejemplo n.º 6
0
        public static void TelaPrincipal()
        {
            V.window.SetView(V.view);

            foreach (Chao x in V.chao.ToList())
            {
                x.Draw();
            }

            foreach (Limite x in V.limites.ToList())
            {
                x.Draw();
            }

            foreach (Teleporte x in V.teleportes.ToList())
            {
                x.Draw();
            }

            V.objetos.Sort((x, y) => x.zindex.CompareTo(y.zindex));
            foreach (Geral x in V.objetos.ToList())
            {
                x.Draw();
            }

            V.window.SetView(V.hud);

            Configuracoes.Draw();
            Efeitos.BackdropRun();
            if (menu)
            {
                F.Menu();
            }

            foreach (IC x in V.interacaoContinua.ToList())
            {
                x.x1.Interagir(1);
            }

            foreach (TempText x in V.temptexts.ToList())
            {
                x.Draw();
            }

            foreach (PopUp x in V.popups.ToList())
            {
                x.Draw();
            }
        }
Ejemplo n.º 7
0
		public static int TelaPrincipal(){
			string[] opcoesMenu = {"Jogar", "Configurações", "Criar Mapa", "Créditos", "Sair"};

			F.DesenharShape(0, 0, Screen.width, Screen.height, 19, 19, 19, 255);
		
			F.Escrever("Cybership", true, Screen.width-F.TxtWidth("Cybership", 50, true)-30, 20, 50, 255, 255, 255, 255);
						
			for(int m=0;m<opcoesMenu.Count();m++)
				F.Escrever(opcoesMenu[m], false, Screen.width-F.TxtWidth(opcoesMenu[m], 32, false)-30, Screen.height/2-40+40*m, 32, 255, 255, 255, 255);

			F.Escrever("v0.5.2 Alpha", false, Screen.width-F.TxtWidth("v0.5.2 Alpha", 32, false)-30, Screen.height-50, 32, 255, 255, 255, 255);

			if(!F.TeclaDesativada("frameMainMenu")){
				frame += frame > 6 ? -frame : 1;
				F.DesativarTecla("frameMainMenu", 300);
			}

			V.img[0].Texture 		= V.IMG_CAT[8][0];
			V.img[0].TextureRect	= new IntRect(0, 0, 27, 15);
			V.img[0].Position 		= new Vector2f(Screen.width-F.TxtWidth(opcoesMenu[option], 32, false)-67, (Screen.height/2)-25+(40*option));
			V.window.Draw(V.img[0]);

			V.img[0].Texture 		= V.IMG_CAT[0][0];
			V.img[0].Position 		= new Vector2f(30, Screen.height-294);
			V.img[0].TextureRect	= new IntRect(96*frame, 0, 96, 136);
			V.img[0].Scale 			= new Vector2f(1.5f, 1.5f);

			V.window.Draw(V.img[0]);

			V.img[0].Scale 			= new Vector2f(1, 1);
			
			if((F.Key("down") && !F.TeclaDesativada("option")) && option < opcoesMenu.Length-1){
				option++;
				F.DesativarTecla("option", 175);
			}
			else if((F.Key("up") && !F.TeclaDesativada("option"))  && option > 0){
				option--;
				F.DesativarTecla("option", 175);
			}
			else if(F.Key("x") && !F.TeclaDesativada("x")){
				F.DesativarTecla("x", 175);
				F.DesativarTecla("mouseLeft", 175);
				return option;
			}

			Efeitos.BackdropRun();

			return -1;
		}
Ejemplo n.º 8
0
        public override void OnStart()
        {
            Efeitos.Backdrop("fade-out", 0, 2.5f);

            for (int i = 0; i < 8; i++)
            {
                for (int j = -1; j < 6; j++)
                {
                    V.background.Add(new Background((i % 2 == 0 ? 0 : 1), (j % 2 == 0 ? i : i - 0.5f), j));
                }
            }

            Idk.windowColor = new Color(000, 000, 000);
            V.view.Center   = new Vector2f(Screen.width / 2, (Screen.height / 2) + 128);
        }
Ejemplo n.º 9
0
        public override void OnStart()
        {
            Idk.windowColor   = new Color(255, 255, 255);
            Efeitos.opacidade = 0;
            Efeitos.Backdrop("fade-in-white", 255, 2.55f);

            step       = 0;
            cowOpacity = 0;
            npcX       = npc.x - (V.view.Center.X - (Screen.width / 2));
            npcY       = (npc.y + npc.height - npc.imgHeight) - (V.view.Center.Y - (Screen.height / 2));

            atributoUm   = 0;
            atributoDois = 0;
            atributoTres = 0;

            atributoUmY   = 20;
            atributoDoisY = 20;
            atributoTresY = 20;
        }
Ejemplo n.º 10
0
        public override void OnStart()
        {
            Idk.windowColor   = new Color(255, 255, 255);
            Screen.width      = 800;
            Screen.height     = 600;
            V.window.Position = new Vector2i((int)(VideoMode.DesktopMode.Width / 2) - (int)(Screen.width / 2), (int)(VideoMode.DesktopMode.Height / 2) - (int)(Screen.height / 2) - 30);

            SQLiteDataReader reader = Conexao.LoadData("select * from controle");

            while (reader.Read())
            {
                V.controles.Add(new Controle(Convert.ToInt32(reader["id"]), Convert.ToString(reader["nome"]), Convert.ToInt32(reader["keycode"])));
            }

            logo = new Texture("res/logo.png");

            Efeitos.opacidade = 255;
            Efeitos.Backdrop("fade-out", 0, 1.25f);
            V.DbLoad();
        }
Ejemplo n.º 11
0
        public static void Video2()
        {
            V.img[0].Texture     = V.IMG_CAT[1][6];
            V.img[0].TextureRect = new IntRect(0, 0, (int)npc.imgWidth, (int)npc.imgHeight);
            V.img[0].Position    = new Vector2f(npcX, npcY);
            V.img[0].Color       = new Color(255, 255, 255, 255);
            V.window.Draw(V.img[0]);

            V.img[0].Texture     = V.IMG_CAT[13][1];
            V.img[0].TextureRect = new IntRect(0, 0, 100, 88);
            V.img[0].Position    = new Vector2f(npcX - 350, npcY + 150);
            V.img[0].Color       = new Color(255, 255, 255, (byte)cowOpacity);
            V.window.Draw(V.img[0]);

            F.Escrever("-Latir", true, npcX - 370 + 80 - (F.TxtWidth("-Latir", 30, true) / 2), npcY + 280 + atributoUmY, 30, 000, 000, 000, (byte)atributoUm);
            F.Escrever("-Dormir", true, npcX - 370 + 80 - (F.TxtWidth("-Dormir", 30, true) / 2), npcY + 310 + atributoDoisY, 30, 000, 000, 000, (byte)atributoDois);
            F.Escrever("-Comer", true, npcX - 370 + 80 - (F.TxtWidth("-Comer", 30, true) / 2), npcY + 340 + atributoTresY, 30, 000, 000, 000, (byte)atributoTres);

            float o = cowOpacity > 200 ? 200 : cowOpacity;

            F.DesenharShape(npcX + 180, npcY + 145, 355, 120, 000, 000, 000, o);
            new RichText(npcX + 190, npcY + 150, 24, true, (byte)cowOpacity, @"#f92659public static #3da3efvoid #a6e22eLatir#ffffff(){}/n/n#f92659public static #3da3efvoid #a6e22eDormir#ffffff(){}/n/n#f92659public static #3da3efvoid #a6e22eComer#ffffff(){}/n");

            V.img[0].Color = new Color(255, 255, 255, 255);

            switch (step)
            {
            case 0:
                if (Efeitos.opacidade >= 255 && npcY > 50)
                {
                    npcY--;
                }
                else if (npcY <= 50 && Efeitos.opacidade >= 50)
                {
                    step++;
                }
                break;

            case 1:
                if (F.txtAlerta == "")
                {
                    F.Alerta("Não quero perder meu tempo, então vou explicar resumidamente...");
                }
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Dentro da programação, #00ffffmétodos #fffffffuncionam como #ff0000scripts./n/n/n/n/n/n/n/n~#ffffffUm #ff0000script #ffffffé um conjunto de comandos~");
                    step++;
                }
                break;

            case 2:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Por exemplo, o #00ffffobjeto #ff0000cachorro #ffffffpossui os #00ffffmétodos #ffffffLatir, Dormir e Comer.");
                    step++;
                }
                break;

            case 3:
                if (F.letraAtual >= 24 && cowOpacity < 255)
                {
                    cowOpacity += 2.55f;
                }

                if (F.letraAtual >= 70)
                {
                    if (atributoUm < 255)
                    {
                        atributoUm += 2.55f;
                    }
                    if (atributoUmY > 0)
                    {
                        atributoUmY -= 1;
                    }
                }

                if (F.letraAtual >= 76)
                {
                    if (atributoDois < 255)
                    {
                        atributoDois += 2.55f;
                    }
                    if (atributoDoisY > 0)
                    {
                        atributoDoisY -= 1;
                    }
                }

                if (F.letraAtual >= 83)
                {
                    if (atributoTres < 255)
                    {
                        atributoTres += 2.55f;
                    }
                    if (atributoTresY > 0)
                    {
                        atributoTresY -= 1;
                    }
                }

                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Bem, esse é o conceito de um #00ffffmétodo#ffffff, agora me deixe trabalhar.");
                    step++;
                }
                break;

            case 4:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    cowOpacity        = 255;
                    atributoUm        = 255;
                    atributoDois      = 255;
                    atributoTres      = 255;
                    Efeitos.opacidade = 255;

                    step++;
                }
                break;

            case 5:
                cowOpacity   -= cowOpacity <= 0 ? cowOpacity : 2.55f;
                atributoUm   -= atributoUm <= 0 ? atributoUm : 2.55f;
                atributoDois -= atributoDois <= 0 ? atributoDois : 2.55f;
                atributoTres -= atributoTres <= 0 ? atributoTres : 2.55f;

                if (cowOpacity <= 0)
                {
                    if (npcY < (npc.y + npc.height - npc.imgHeight) - (V.view.Center.Y - (Screen.height / 2)))
                    {
                        npcY++;
                    }
                    else if (npcY >= (npc.y + npc.height - npc.imgHeight) - (V.view.Center.Y - (Screen.height / 2)) && Efeitos.opacidade > 0)
                    {
                        Efeitos.opacidade -= 2.55f;
                        Efeitos.Backdrop("fade-out-white", 0, 2.55f);
                        step++;
                    }
                }
                break;

            case 6:
                if (Efeitos.opacidade <= 0)
                {
                    V.objetos[V.objetos.IndexOf(npc)].step = 0;
                    CurrentScreen.Change("localmap");
                }
                break;
            }
        }
Ejemplo n.º 12
0
        public static void Video1()
        {
            V.img[0].Texture     = V.IMG_CAT[1][3];
            V.img[0].TextureRect = new IntRect(0, 0, (int)npc.imgWidth, (int)npc.imgHeight);
            V.img[0].Position    = new Vector2f(npcX, npcY);
            V.img[0].Color       = new Color(255, 255, 255, 255);
            V.window.Draw(V.img[0]);

            V.img[0].Texture     = V.IMG_CAT[13][0];
            V.img[0].TextureRect = new IntRect(0, 0, 160, 96);
            V.img[0].Position    = new Vector2f(npcX - 350, npcY + 150);
            V.img[0].Color       = new Color(255, 255, 255, (byte)cowOpacity);
            V.window.Draw(V.img[0]);

            F.Escrever("-Nome", true, npcX - 350 + 80 - (F.TxtWidth("-Nome", 30, true) / 2), npcY + 280 + atributoUmY, 30, 000, 000, 000, (byte)atributoUm);
            F.Escrever("-Peso", true, npcX - 350 + 80 - (F.TxtWidth("-Peso", 30, true) / 2), npcY + 310 + atributoDoisY, 30, 000, 000, 000, (byte)atributoDois);
            F.Escrever("-Altura", true, npcX - 350 + 80 - (F.TxtWidth("-Altura", 30, true) / 2), npcY + 340 + atributoTresY, 30, 000, 000, 000, (byte)atributoTres);

            float o = cowOpacity > 200 ? 200 : cowOpacity;

            F.DesenharShape(npcX + 180, npcY + 145, 290, 120, 000, 000, 000, o);
            new RichText(npcX + 190, npcY + 150, 24, true, (byte)cowOpacity, @"#3da3efVaca #ffffffvaca #f92659= new #3da3efVaca#ffffff();/n/nvaca.nome #f92659= #e6db5a""Loló""#ffffff;/nvaca.peso #f92659= #ae81ff720#3da3eff#ffffff;/nvaca.altura #f92659= #ae81ff1.5#3da3eff#ffffff;");

            V.img[0].Color = new Color(255, 255, 255, 255);

            switch (step)
            {
            case 0:
                if (Efeitos.opacidade >= 255 && npcY > 50)
                {
                    npcY--;
                }
                else if (npcY <= 50 && Efeitos.opacidade >= 50)
                {
                    step++;
                }
                break;

            case 1:
                if (F.txtAlerta == "")
                {
                    F.Alerta("Até onde sabemos, a #ff0000torre #ffffffpossui somente um enigma. /nPara resolvê-lo, você precisará saber o que são #00ffffobjetos #ffffffe #00ffffatributos#ffffff.");
                }
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Em resumo, um #00ffffobjeto #ffffffé uma #ff0000variável #ffffffque pode armazenar vários valores./n/n/n/n/n/n/n/n~Uma #ff0000variável #ffffffé algo que pode armazenar um valor, como um número ou uma palavra~");
                    step++;
                }
                break;

            case 2:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Chamamos esses valores de #00ffffatributos.");
                    step++;
                }
                break;

            case 3:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("Um exemplo?/nHmmm.../nAh, Claro!");
                    step++;
                }
                break;

            case 4:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("O #00ffffobjeto #ff0000vaca #ffffffpossui os #00ffffatributos #ffffffnome, peso e altura.");
                    step++;
                }
                break;

            case 5:
                if (F.letraAtual >= 24 && cowOpacity < 255)
                {
                    cowOpacity += 2.55f;
                }

                if (F.letraAtual >= 70)
                {
                    if (atributoUm < 255)
                    {
                        atributoUm += 2.55f;
                    }
                    if (atributoUmY > 0)
                    {
                        atributoUmY -= 1;
                    }
                }

                if (F.letraAtual >= 76)
                {
                    if (atributoDois < 255)
                    {
                        atributoDois += 2.55f;
                    }
                    if (atributoDoisY > 0)
                    {
                        atributoDoisY -= 1;
                    }
                }

                if (F.letraAtual >= 83)
                {
                    if (atributoTres < 255)
                    {
                        atributoTres += 2.55f;
                    }
                    if (atributoTresY > 0)
                    {
                        atributoTresY -= 1;
                    }
                }

                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    F.Alerta("O quê? Sim, uma vaca é um animal, e não um objeto.../nNão sei se conseguiria explicar isso, talvez alguém de outra cidade consiga.");
                    step++;
                }
                break;

            case 6:
                if (F.Key("x") && !F.TeclaDesativada("x") && F.letraAtual >= F.txtAlerta.Length && Configuracoes.letraTempo == 50)
                {
                    cowOpacity        = 255;
                    atributoUm        = 255;
                    atributoDois      = 255;
                    atributoTres      = 255;
                    Efeitos.opacidade = 255;

                    step++;
                }
                break;

            case 7:
                cowOpacity   -= cowOpacity <= 0 ? cowOpacity : 2.55f;
                atributoUm   -= atributoUm <= 0 ? atributoUm : 2.55f;
                atributoDois -= atributoDois <= 0 ? atributoDois : 2.55f;
                atributoTres -= atributoTres <= 0 ? atributoTres : 2.55f;

                if (cowOpacity <= 0)
                {
                    if (npcY < (npc.y + npc.height - npc.imgHeight) - (V.view.Center.Y - (Screen.height / 2)))
                    {
                        npcY++;
                    }
                    else if (npcY >= (npc.y + npc.height - npc.imgHeight) - (V.view.Center.Y - (Screen.height / 2)) && Efeitos.opacidade > 0)
                    {
                        Efeitos.opacidade -= 2.55f;
                        Efeitos.Backdrop("fade-out-white", 0, 2.55f);
                        step++;
                    }
                }
                break;

            case 8:
                if (Efeitos.opacidade <= 0)
                {
                    V.objetos[V.objetos.IndexOf(npc)].step = 0;
                    CurrentScreen.Change("localmap");
                }
                break;
            }
        }
Ejemplo n.º 13
0
        public static void Menu()
        {
            x = Configuracoes.controle;

            for (int m = 0; m < 3; m++)
            {
                for (int n = 0; n < 3; n++)
                {
                    menuArray[m, n] = -1;
                }
            }

            if (F.Key("esc") && !x.menu && !x.pausado && !F.TeclaDesativada("esc"))
            {
                x.menu     = true;
                x.menuType = 0;
                F.DesativarTecla("esc", 300);
                Efeitos.Backdrop("fade-in", 125, 25);
            }
            else if (F.Key("esc") && x.menu && !F.TeclaDesativada("esc"))
            {
                x.menu = false;
                F.DesativarTecla("esc", 300);
                F.BloquearMov(x, false);
                Efeitos.Backdrop("fade-out", 0, 25);
            }

            if (F.Key("enter") && !x.menu && !x.pausado && !F.TeclaDesativada("enter"))
            {
                x.menu     = true;
                x.menuType = 1;
                F.DesativarTecla("enter", 300);
                Efeitos.Backdrop("fade-in", 125, 25);
            }
            else if (F.Key("enter") && x.menu && !F.TeclaDesativada("enter"))
            {
                x.menu = false;
                F.DesativarTecla("enter", 300);
                F.BloquearMov(x, false);
                Efeitos.Backdrop("fade-out", 0, 25);
            }

            if (x.menu && x.menuType == 0)
            {
                V.window.SetView(V.hud);

                F.BloquearMov(x, true);

                string[] e = new string[3];
                e[0] = "Continuar";
                e[1] = "Mapa";
                e[2] = "Menu Principal";

                if (F.Key("up") && sY > 0 && !F.TeclaDesativada("up") && !F.MouseIn(((Screen.width - 240) / 2), ((Screen.height - 400) / 2), 240, 240))
                {
                    sY--;
                    F.DesativarTecla("up", 125);
                }
                if (F.Key("down") && sY < 2 && !F.TeclaDesativada("down") && !F.MouseIn(((Screen.width - 240) / 2), ((Screen.height - 400) / 2), 240, 240))
                {
                    sY++;
                    F.DesativarTecla("down", 125);
                }

                for (int m = 0; m < 3; m++)
                {
                    cA = (m == mA && mY == -1) ? (byte)35 : (byte)19;

                    if (sY == m)
                    {
                        cX = 35;
                        cY = 255;
                        if (F.Key("x"))
                        {
                            switch (m)
                            {
                            case 0:
                                x.menu = false;
                                F.BloquearMov(x, false);
                                F.DesativarTecla("esc", 300);
                                F.DesativarTecla("x", 300);
                                Efeitos.Backdrop("fade-out", 0, 25);
                                break;

                            case 1:
                                CurrentScreen.Change("worldmap");
                                break;

                            case 2:
                                Idk.DeletarMapa();
                                CurrentScreen.Change("mainmenu");

                                x.menu = false;
                                F.BloquearMov(x, false);
                                F.DesativarTecla("esc", 300);
                                F.DesativarTecla("x", 300);
                                Efeitos.Backdrop("fade-out", 0, 25);
                                break;
                            }
                        }
                    }
                    else
                    {
                        cX = 19;
                        cY = 130;
                    }

                    F.DesenharShape(((Screen.width - 240) / 2), ((Screen.height - 400) / 2) + 80 * m, 240, 80, cX, cX, cX, 255);
                    F.Escrever(e[m], true, ((Screen.width - 240) / 2) + 120 - (F.TxtWidth(e[m], 32, true) / 2), ((Screen.height - 400) / 2) + 16 + (80 * m), 32, cY, cY, cY, 230);
                }
            }

            if (x.menu && x.menuType == 1)
            {
                F.BloquearMov(x, true);
                F.DesenharShape(((Screen.width - 720) / 2), ((Screen.height - 400) / 2), 720, 400, 210, 210, 210, 230);

                string[] e = new string[3];
                e[0] = "Itens";
                e[1] = "Recursos";
                e[2] = "Habilidades";

                for (int m = 0; m < 3; m++)
                {
                    cA = (m == mA && mY == -1) ? (byte)35 : (byte)19;
                    F.DesenharShape(((Screen.width - 720) / 2) + (240 * m), ((Screen.height - 400) / 2), 240, 80, cA, cA, cA, 255);

                    cA = (m == mA) ? (byte)255 : (byte)130;
                    F.Escrever(e[m], true, ((Screen.width - 720) / 2) + 120 - (F.TxtWidth(e[m], 32, true) / 2) + (240 * m), ((Screen.height - 400) / 2) + 16, 32, cA, cA, cA, 230);
                }

                if (mY == -1)
                {
                    mX = 0;
                }

                if (mA < 2)
                {
                    for (int m = 0; m < 3; m++)
                    {
                        for (int n = 0; n < 3; n++)
                        {
                            cA = (m == mY && n == mX) ? (byte)35 : (byte)19;
                            F.DesenharShape(((Screen.width - 720) / 2) + 20 + (100 * n), ((Screen.height - 400) / 2) + 100 + (100 * m), 80, 80, cA, cA, cA, 255);

                            if (mA == 0 && x.itens.Count > (m * 3) + n)
                            {
                                menuArray[m, n]      = V.itens.IndexOf(x.itens[(m * 3) + n]);
                                V.img[1].Texture     = V.IMG_CAT[5][x.itens[(m * 3) + n].sprite];
                                V.img[1].Scale       = new Vector2f((float)80 / V.IMG_CAT[5][x.itens[(m * 3) + n].sprite].Size.X, (float)80 / V.IMG_CAT[5][x.itens[(m * 3) + n].sprite].Size.Y);
                                V.img[1].Position    = new Vector2f(((Screen.width - 720) / 2) + 20 + (100 * n), ((Screen.height - 400) / 2) + 100 + (100 * m));
                                V.img[1].TextureRect = new IntRect(0, 0, (int)V.IMG_CAT[5][x.itens[(m * 3) + n].sprite].Size.X, (int)V.IMG_CAT[5][x.itens[(m * 3) + n].sprite].Size.Y);
                                V.window.Draw(V.img[1]);

                                F.Escrever("" + x.itens[(m * 3) + n].quantidade, true, ((Screen.width - 720) / 2) + 96 + (100 * n) - F.TxtWidth("" + x.itens[(m * 3) + n].quantidade, 20, true), ((Screen.height - 400) / 2) + 156 + (100 * m), 18, 255, 255, 255, 255, 000, 000, 000, 255, 2);
                            }
                            if (mA == 1 && x.recursos.Count > (m * 3) + n)
                            {
                                menuArray[m, n]      = (m * 3) + n;
                                V.img[1].Texture     = V.IMG_CAT[6][x.recursos[menuArray[m, n]].sprite];
                                V.img[1].Scale       = new Vector2f((float)80 / V.IMG_CAT[6][x.recursos[menuArray[m, n]].sprite].Size.X, (float)80 / V.IMG_CAT[6][x.recursos[menuArray[m, n]].sprite].Size.Y);
                                V.img[1].Position    = new Vector2f(((Screen.width - 720) / 2) + 20 + (100 * n), ((Screen.height - 400) / 2) + 100 + (100 * m));
                                V.img[1].TextureRect = new IntRect(0, 0, (int)V.IMG_CAT[6][x.recursos[menuArray[m, n]].sprite].Size.X, (int)V.IMG_CAT[6][x.recursos[menuArray[m, n]].sprite].Size.Y);
                                V.window.Draw(V.img[1]);

                                F.Escrever("" + x.recursos[menuArray[m, n]].quantidade, true, ((Screen.width - 720) / 2) + 96 + (100 * n) - F.TxtWidth("" + x.recursos[menuArray[m, n]].quantidade, 20, true), ((Screen.height - 400) / 2) + 156 + (100 * m), 18, 255, 255, 255, 255, 000, 000, 000, 255, 2);
                            }

                            rN++;
                        }
                    }

                    F.DesenharShape(((Screen.width - 720) / 2) + 320, ((Screen.height - 400) / 2) + 100, 380, 280, 000, 000, 000, 230);

                    if (mA == 0 && mY > -1 && menuArray[mY, mX] != -1)
                    {
                        V.img[1].Texture     = V.IMG_CAT[5][x.itens[(mY * 3) + mX].sprite];
                        V.img[1].Scale       = new Vector2f((float)80 / V.IMG_CAT[5][x.itens[(mY * 3) + mX].sprite].Size.X, (float)80 / V.IMG_CAT[5][x.itens[(mY * 3) + mX].sprite].Size.Y);
                        V.img[1].Position    = new Vector2f(((Screen.width - 720) / 2) + 320, ((Screen.height - 400) / 2) + 100);
                        V.img[1].TextureRect = new IntRect(0, 0, (int)V.IMG_CAT[5][x.itens[(mY * 3) + mX].sprite].Size.X, (int)V.IMG_CAT[5][x.itens[(mY * 3) + mX].sprite].Size.Y);
                        V.window.Draw(V.img[1]);

                        F.Escrever(V.itens[menuArray[mY, mX]].nome, true, ((Screen.width - 720) / 2) + 420, ((Screen.height - 400) / 2) + 95, 42, 255, 255, 255, 230);
                        F.Escrever(V.itens[menuArray[mY, mX]].descricao, true, ((Screen.width - 720) / 2) + 335, ((Screen.height - 400) / 2) + 185, 28, 255, 255, 255, 230);

                        if (F.Key("x") && !F.TeclaDesativada("x") && !F.TeclaDesativada("enter"))
                        {
                            x.item = V.itens[menuArray[mY, mX]];

                            x.menu = false;
                            F.DesativarTecla("enter", 300);
                            F.DesativarTecla("x", 300);
                            F.BloquearMov(x, false);
                            Efeitos.Backdrop("fade-out", 0, 25);
                        }
                    }

                    else if (mA == 1 && mY > -1 && menuArray[mY, mX] != -1)
                    {
                        V.img[1].Texture     = V.IMG_CAT[6][x.recursos[menuArray[mY, mX]].sprite];
                        V.img[1].Scale       = new Vector2f((float)80 / V.IMG_CAT[6][x.recursos[menuArray[mY, mX]].sprite].Size.X, (float)80 / V.IMG_CAT[6][x.recursos[menuArray[mY, mX]].sprite].Size.Y);
                        V.img[1].Position    = new Vector2f(((Screen.width - 720) / 2) + 320, ((Screen.height - 400) / 2) + 100);
                        V.img[1].TextureRect = new IntRect(0, 0, (int)V.IMG_CAT[6][x.recursos[menuArray[mY, mX]].sprite].Size.X, (int)V.IMG_CAT[6][x.recursos[menuArray[mY, mX]].sprite].Size.Y);
                        V.window.Draw(V.img[1]);

                        F.Escrever(x.recursos[menuArray[mY, mX]].nome, true, ((Screen.width - 720) / 2) + 420, ((Screen.height - 400) / 2) + 95, 42, 255, 255, 255, 230);
                        F.Escrever(x.recursos[menuArray[mY, mX]].descricao, true, ((Screen.width - 720) / 2) + 335, ((Screen.height - 400) / 2) + 185, 28, 255, 255, 255, 230);
                        F.Escrever("Quantidade: " + x.recursos[menuArray[mY, mX]].quantidade, true, ((Screen.width - 720) / 2) + 685 - F.TxtWidth("Quantidade: " + x.recursos[menuArray[mY, mX]].quantidade, 28, true), ((Screen.height - 400) / 2) + 335, 28, 255, 255, 255, 230);
                    }

                    if (F.Key("c") && !F.TeclaDesativada("c") && !F.TeclaDesativada("enter"))
                    {
                        x.item = null;

                        x.menu = false;
                        F.DesativarTecla("enter", 300);
                        F.DesativarTecla("c", 300);
                        F.BloquearMov(x, false);
                        Efeitos.Backdrop("fade-out", 0, 25);
                    }

                    if (F.Key("right") && !F.TeclaDesativada("menuMove"))
                    {
                        if (mY == -1 && mA < 2)
                        {
                            mA++;
                        }
                        else if (mY > -1 && mX < 2)
                        {
                            mX++;
                        }

                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("left") && !F.TeclaDesativada("menuMove"))
                    {
                        if (mY == -1 && mA > 0)
                        {
                            mA--;
                        }
                        else if (mY > -1 && mX > 0)
                        {
                            mX--;
                        }

                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("up") && !F.TeclaDesativada("menuMove") && mY > -1)
                    {
                        mY--;
                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("down") && !F.TeclaDesativada("menuMove") && mY < 2)
                    {
                        mY++;
                        F.DesativarTecla("menuMove", 175);
                    }
                }
                else
                {
                    int m;
                    if (mX > 1)
                    {
                        mX = 1;
                    }
                    if (mX == 0)
                    {
                        hY = 0;
                    }

                    for (m = 0; m < 3; m++)
                    {
                        cA = (mX == 0 && m == mY) ? (byte)35 : (byte)19;
                        F.DesenharShape(((Screen.width - 720) / 2) + 20, ((Screen.height - 400) / 2) + 100 + (100 * m), 80, 80, cA, cA, cA, 255);

                        byte c = (mY == m) ? (byte)255 : (byte)135;
                        F.Escrever("" + (m + 1), true, ((Screen.width - 720) / 2) + 60 - (F.TxtWidth("" + (m + 1), 34, true) / 2), ((Screen.height - 400) / 2) + 113.5f + (100 * m), 34, c, c, c, 255);
                    }

                    F.DesenharShape(((Screen.width - 720) / 2) + 220, ((Screen.height - 400) / 2) + 100, 480, 280, 000, 000, 000, 230);

                    if (mY > -1)
                    {
                        F.Escrever(Configuracoes.controle.skills[mY].Nome(), true, ((Screen.width - 720) / 2) + 265, ((Screen.height - 400) / 2) + 105, 34, 255, 255, 255, 255);

                        for (m = 3; m < Configuracoes.controle.skills.Count(); m++)
                        {
                            byte c = (Configuracoes.controle.skills[m] == Configuracoes.controle.skills[mY]) ? (byte)255 : (byte)135;
                            F.Escrever(Configuracoes.controle.skills[m].Nome(), true, ((Screen.width - 720) / 2) + 265, ((Screen.height - 400) / 2) + 105 + (45 * (m - 2)), 34, c, c, c, 255);
                        }

                        if (mX == 1)
                        {
                            V.img[0].Texture     = V.IMG_CAT[8][0];
                            V.img[0].TextureRect = new IntRect(0, 0, 27, 15);
                            V.img[0].Position    = new Vector2f(((Screen.width - 720) / 2) + 230, ((Screen.height - 400) / 2) + 120 + (45 * hY));
                            V.window.Draw(V.img[0]);
                        }
                    }

                    if (F.Key("x") && !F.TeclaDesativada("x"))
                    {
                        if (mX == 1 && hY > 0)
                        {
                            Skill tmp = Configuracoes.controle.skills[mY];
                            Configuracoes.controle.skills[mY]     = Configuracoes.controle.skills[hY + 2];
                            Configuracoes.controle.skills[hY + 2] = tmp;
                        }

                        mX = mX == 0 ? 1 : 0;
                        F.DesativarTecla("x", 300);
                    }

                    if (F.Key("c") && !F.TeclaDesativada("c") && mX == 1)
                    {
                        mX = 0;
                        F.DesativarTecla("x", 300);
                    }


                    if (F.Key("right") && !F.TeclaDesativada("menuMove") && mY == -1 && mA < 2)
                    {
                        mA++;
                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("left") && !F.TeclaDesativada("menuMove") && mY == -1 && mA > 0)
                    {
                        mA--;
                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("up") && !F.TeclaDesativada("menuMove") && mY > -1)
                    {
                        if (mX == 0)
                        {
                            mY--;
                        }
                        if (mX == 1 && hY > 0)
                        {
                            hY--;
                        }
                        F.DesativarTecla("menuMove", 175);
                    }
                    else if (F.Key("down") && !F.TeclaDesativada("menuMove"))
                    {
                        if (mX == 0 && mY < 2)
                        {
                            mY++;
                        }
                        if (mX == 1 && hY < Configuracoes.controle.skills.Count() - 3)
                        {
                            hY++;
                        }
                        F.DesativarTecla("menuMove", 175);
                    }
                }
            }

            F.DesenharShape(0, Screen.height - 25, Screen.width, 25, 239, 239, 239, 230);

            //XP
            F.DesenharShape(((Screen.width - (Screen.width / 3)) / 2), Screen.height - 20, Screen.width / 3, 15, 000, 000, 000, 230);
            F.DesenharShape(((Screen.width - (Screen.width / 3)) / 2), Screen.height - 20, ((x.xpA - V.nivelArray[V.personagem.nivel]) / (V.nivelArray[V.personagem.nivel + 1] - V.nivelArray[V.personagem.nivel])) * (Screen.width / 3), 15, 000, 255, 000, 230);
            F.Escrever("XP", true, ((Screen.width - (Screen.width / 3)) / 2) - 30, Screen.height - 30, 24, 000, 000, 000, 230);

            //VIDA
            F.DesenharShape(Screen.width - 30, 80, 20, 125, 239, 239, 239, 230);
            F.DesenharShape(Screen.width - 30, 205, 20, (float)-(x.vidaA * 1.25), 000, 255, 000, 230);

            //ATALHO MENU
            F.DesenharShape(Screen.width - 70, 10, 60, 60, 239, 239, 239, 230);

            Item i = Configuracoes.controle.item;

            if (i != null)
            {
                V.img[1].Texture     = V.IMG_CAT[5][i.sprite];
                V.img[1].Scale       = new Vector2f((float)60 / V.IMG_CAT[5][i.sprite].Size.X, (float)60 / V.IMG_CAT[5][i.sprite].Size.Y);
                V.img[1].TextureRect = new IntRect(0, 0, (int)V.IMG_CAT[5][i.sprite].Size.X, (int)V.IMG_CAT[5][i.sprite].Size.Y);
                V.img[1].Position    = new Vector2f(Screen.width - 70, 10);
                V.window.Draw(V.img[1]);
            }
        }
Ejemplo n.º 14
0
        public static void Fim()
        {
            V.window.SetView(V.hud);
            Efeitos.BackdropRun();

            switch (transition_state)
            {
            case 0:
                F.DesativarTecla("transition_state", 1500);

                V.bullets.Clear();
                V.backdrop = false;
                fim        = DateTime.Now;

                transition_state++;
                break;

            case 1:
                if (!F.TeclaDesativada("transition_state"))
                {
                    if (!V.multiplayer)
                    {
                        if (player1.y + player1.height > 0 || player1.x + player1.width / 2 != Screen.width / 2)
                        {
                            player1.y -= (player1.y + player1.height > 0 ? (player1.x + player1.width / 2 == Screen.width / 2 ? player1.speed * 2 : player1.speed / 2) : 0);
                            player1.x += (player1.x + player1.width / 2 == Screen.width / 2 ? 0 : (player1.x + player1.width / 2 > Screen.width / 2 ? -player1.speed / 2 : player1.speed / 2));

                            if (Math.Abs(player1.x + player1.width / 2 - Screen.width / 2) < 5)
                            {
                                player1.x = Screen.width / 2 - player1.width / 2;
                            }

                            break;
                        }
                    }
                    else
                    if (player1.y + player1.height > 0 || player2.y + player2.height > 0 || player1.x + player1.width / 2 != Screen.width * 0.25f || player2.x + player2.width / 2 != Screen.width * 0.75f)
                    {
                        player1.y -= (player1.y + player1.height > 0 ? (player1.x + player1.width / 2 == Screen.width * 0.25f ? player1.speed * 2 : player1.speed / 2) : 0);
                        player1.x += (player1.x + player1.width / 2 == Screen.width * 0.25f ? 0 : (player1.x + player1.width / 2 > Screen.width * 0.25f ? -player1.speed / 2 : player1.speed / 2));

                        player2.y -= (player2.y + player2.height > 0 ? (player2.x + player2.width / 2 == Screen.width * 0.75f ? player2.speed * 2 : player2.speed / 2) : 0);
                        player2.x += (player2.x + player2.width / 2 == Screen.width * 0.75f ? 0 : (player2.x + player2.width / 2 > Screen.width * 0.75f ? -player2.speed / 2 : player2.speed / 2));

                        if (Math.Abs(player1.x + player1.width / 2 - Screen.width * 0.25f) < 5)
                        {
                            player1.x = Screen.width * 0.25f - player1.width / 2;
                        }
                        if (Math.Abs(player2.x + player2.width / 2 - Screen.width * 0.75f) < 5)
                        {
                            player2.x = Screen.width * 0.75f - player2.width / 2;
                        }

                        break;
                    }

                    F.DesativarTecla("transition_state", 750);
                    transition_state++;
                }
                break;

            case 2:
                if (!F.TeclaDesativada("transition_state"))
                {
                    Efeitos.Backdrop("fade-in", 255, 5f);

                    transition_state++;
                }
                break;

            case 3:
                if (Efeitos.opacidade == 255)
                {
                    F.Escrever("Congratulations!", true, (Screen.width / 2) - (F.TxtWidth("Congratulations!", 60, true) / 2), (Screen.height / 2) - 200, 60, 255, 255, 255, (byte)txt_op, 000, 000, 47, 255, 1);
                    F.Escrever("You have finished the game!", false, (Screen.width / 2) - (F.TxtWidth("You have finished the game!!", 32, false) / 2), (Screen.height / 2) - 140, 32, 255, 255, 255, (byte)txt_op, 000, 000, 47, 255, 1);

                    txt_op += 2.5f;
                }
                if (txt_op == 255)
                {
                    txt_op = 0;
                    transition_state++;
                }
                break;

            case 4:
                if (!F.TeclaDesativada("a") && (F.Key("a") || F.Key("d")) && txt_op >= 255)
                {
                    gameover_option = !gameover_option;
                    F.DesativarTecla("a", 250);
                }

                if (F.Key("space") && txt_op >= 255)
                {
                    if (gameover_option)
                    {
                        level++;

                        player1.x = V.multiplayer ? Screen.width * 0.25f : (Screen.width / 2) - 32;
                        player1.y = Screen.height + 46;

                        if (V.multiplayer)
                        {
                            player2.x = Screen.width * 0.75f;
                            player2.y = Screen.height + 46;
                        }

                        ResetVars(false);

                        F.DesativarTecla("space", 300);
                    }
                    else
                    {
                        CurrentScreen.Change("mainmenu");
                    }

                    F.DesativarTecla("space", 300);
                }
                else
                {
                    F.Escrever("Congratulations!", true, (Screen.width / 2) - (F.TxtWidth("Congratulations!", 60, true) / 2), (Screen.height / 2) - 200, 60, 255, 255, 255, (byte)255, 000, 000, 47, 255, 1);
                    F.Escrever("You have finished the game!", false, (Screen.width / 2) - (F.TxtWidth("You have finished the game!!", 32, false) / 2), (Screen.height / 2) - 140, 32, 255, 255, 255, (byte)255, 000, 000, 47, 255, 1);

                    F.Escrever("Level........................................... " + level, false, (Screen.width / 4), (Screen.height / 2) - 90, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Score.......................................... " + score, false, (Screen.width / 4), (Screen.height / 2) - 55, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Enemies Killed........................... " + enemies_killed, false, (Screen.width / 4), (Screen.height / 2) - 20, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Time Alive................................... " + String.Format("{0}:{1}", (fim - inicio).Minutes, (fim - inicio).Seconds), false, (Screen.width / 4), (Screen.height / 2) + 15, 36, 255, 255, 255, (byte)txt_op);

                    if (gameover_option)
                    {
                        F.DesenharShape((Screen.width / 2) - (F.TxtWidth("Main Menu", 26, true)) - 6, (Screen.height / 2) + 103, F.TxtWidth("Continue", 26, true) + 12, 30, 255, 255, 255, (byte)txt_op);
                        F.Escrever("Continue", true, (Screen.width / 2) - F.TxtWidth("Continue", 26, true) - 20, (Screen.height / 2) + 100, 26, 000, 000, 000, (byte)txt_op);
                        F.Escrever("Main Menu", true, (Screen.width / 2) + 10, (Screen.height / 2) + 100, 26, 255, 255, 255, (byte)txt_op);
                    }
                    else
                    {
                        F.DesenharShape((Screen.width / 2) + 4, (Screen.height / 2) + 103, F.TxtWidth("Main Menu", 26, true) + 12, 30, 255, 255, 255, (byte)txt_op);
                        F.Escrever("Main Menu", true, (Screen.width / 2) + 10, (Screen.height / 2) + 100, 26, 000, 000, 000, (byte)txt_op);
                        F.Escrever("Continue", true, (Screen.width / 2) - F.TxtWidth("Continue", 26, true) - 20, (Screen.height / 2) + 100, 26, 255, 255, 255, (byte)txt_op);
                    }

                    txt_op += txt_op >= 255 ? 0 : 5;
                }
                break;
            }
        }
Ejemplo n.º 15
0
        public static void GameOver()
        {
            V.window.SetView(V.hud);
            Efeitos.BackdropRun();

            switch (transition_state)
            {
            case 0:
                V.bullets.Clear();
                V.backdrop = false;
                fim        = DateTime.Now;

                F.DesativarTecla("transition_state", 750);

                transition_state++;
                break;

            case 1:
                if (!F.TeclaDesativada("transition_state"))
                {
                    Efeitos.Backdrop("fade-in", 255, 2.5f);

                    transition_state++;
                }
                break;

            case 2:
                if (Efeitos.opacidade == 255)
                {
                    F.Escrever("Game Over", true, (Screen.width / 2) - (F.TxtWidth("Game Over", 60, true) / 2), (Screen.height / 2) - 200, 60, 255, 255, 255, (byte)txt_op, 000, 000, 47, 255, 1);

                    txt_op += 2.5f;
                }
                if (txt_op == 255)
                {
                    txt_op = 0;
                    transition_state++;
                }
                break;

            case 3:
                if (!F.TeclaDesativada("a") && (F.Key("a") || F.Key("d")) && txt_op >= 255)
                {
                    gameover_option = !gameover_option;
                    F.DesativarTecla("a", 250);
                }

                if (F.Key("space") && txt_op >= 255)
                {
                    if (gameover_option)
                    {
                        ResetGame();
                    }
                    else
                    {
                        CurrentScreen.Change("mainmenu");
                    }

                    F.DesativarTecla("space", 300);
                }
                else
                {
                    F.Escrever("Game Over", true, (Screen.width / 2) - (F.TxtWidth("Game Over", 60, true) / 2), (Screen.height / 2) - 200, 60, 255, 255, 255, 255);

                    F.Escrever("Level........................................... " + level, false, (Screen.width / 4), (Screen.height / 2) - 100, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Score.......................................... " + score, false, (Screen.width / 4), (Screen.height / 2) - 65, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Enemies Killed........................... " + enemies_killed, false, (Screen.width / 4), (Screen.height / 2) - 30, 36, 255, 255, 255, (byte)txt_op);
                    F.Escrever("Time Alive................................... " + String.Format("{0}:{1}", (fim - inicio).Minutes, (fim - inicio).Seconds), false, (Screen.width / 4), (Screen.height / 2) + 5, 36, 255, 255, 255, (byte)txt_op);

                    if (gameover_option)
                    {
                        F.DesenharShape((Screen.width / 2) - (F.TxtWidth("Main Menu", 26, true)) - 6, (Screen.height / 2) + 103, F.TxtWidth("Restart", 26, true) + 12, 30, 255, 255, 255, (byte)txt_op);
                        F.Escrever("Restart", true, (Screen.width / 2) - F.TxtWidth("Restart", 26, true) - 30, (Screen.height / 2) + 100, 26, 000, 000, 000, (byte)txt_op);
                        F.Escrever("Main Menu", true, (Screen.width / 2) + 10, (Screen.height / 2) + 100, 26, 255, 255, 255, (byte)txt_op);
                    }
                    else
                    {
                        F.DesenharShape((Screen.width / 2) + 4, (Screen.height / 2) + 103, F.TxtWidth("Main Menu", 26, true) + 12, 30, 255, 255, 255, (byte)txt_op);
                        F.Escrever("Main Menu", true, (Screen.width / 2) + 10, (Screen.height / 2) + 100, 26, 000, 000, 000, (byte)txt_op);
                        F.Escrever("Restart", true, (Screen.width / 2) - F.TxtWidth("Restart", 26, true) - 30, (Screen.height / 2) + 100, 26, 255, 255, 255, (byte)txt_op);
                    }

                    txt_op += txt_op >= 255 ? 0 : 5;
                }
                break;
            }
        }
Ejemplo n.º 16
0
        public override void Draw()
        {
            if (V.window.Size.X < 800 || V.window.Size.Y < 600)
            {
                V.window.Size = new Vector2u(800, 600);
            }

            switch (state)
            {
            case 0:
                if (state_ <= 1 && start)
                {
                    V.window.SetView(V.hud);

                    V.backdrop = false;
                    string txt = level == 5 ? "Free mode" : "Level " + level;
                    F.Escrever(txt, true, (Screen.width / 2) - (F.TxtWidth(txt, 60, true) / 2), (Screen.height / 2) - 100, 60, 255, 255, 255, 255, 000, 000, 47, 255, 1);

                    if (state_ == 0)
                    {
                        F.DesativarTecla("state", 2000); state_++;
                    }
                    if (state_ == 1 && !F.TeclaDesativada("state"))
                    {
                        F.DesativarTecla("state", 2000); state_++; V.backdrop = true; start = false; Efeitos.Backdrop("fade-out", 0, 2.5f);
                    }
                }

                if (state_ > 1 && state_ <= 3)
                {
                    V.window.SetView(V.hud);

                    TelaPrincipal();
                    F.Escrever("Ready?", true, (Screen.width / 2) - (F.TxtWidth("Ready?", 60, true) / 2), (Screen.height / 2) - 100, 60, 255, 255, 255, 255, 000, 000, 47, 255, 2);

                    if (state_ == 2)
                    {
                        F.DesativarTecla("state", 1000); state_++;
                    }
                    if (state_ == 3 && !F.TeclaDesativada("state"))
                    {
                        F.DesativarTecla("state", 1000); state_++;
                    }
                }

                if (state_ > 3 && state_ <= 5)
                {
                    V.window.SetView(V.hud);

                    TelaPrincipal();
                    F.Escrever("Go!", true, (Screen.width / 2) - (F.TxtWidth("Go!", 60, true) / 2), (Screen.height / 2) - 100, 60, 255, 255, 255, 255, 000, 000, 47, 255, 2);

                    if (state_ == 4)
                    {
                        F.DesativarTecla("state", 500); state_++;
                    }
                    if (state_ == 5 && !F.TeclaDesativada("state"))
                    {
                        F.DesativarTecla("state", 500); state_++; state = 2;
                    }
                }
                break;

            case 1:

                TelaPrincipal();
                Menu();

                break;

            case 2:

                TelaPrincipal();

                break;

            case 3:

                TelaPrincipal();
                GameOver();

                break;

            case 4:

                TelaPrincipal();
                LevelCompleted();

                break;

            case 5:

                TelaPrincipal();
                Fim();

                break;
            }
        }
Ejemplo n.º 17
0
        public static void Menu()
        {
            if (F.Key("esc") && menu && !F.TeclaDesativada("esc"))
            {
                V.backdrop = true;
                menu       = false;
                state      = 0;
                state_     = 2;

                F.AtivarTecla("bullet");
                F.DesativarTecla("bullet", 500);

                F.DesativarTecla("esc", 300);
                Efeitos.Backdrop("fade-out", 0, 25);
            }

            V.window.SetView(V.hud);
            Efeitos.BackdropRun();

            string[] e = new string[2];
            e[0] = "Continuar";
            e[1] = "Menu Principal";

            if ((F.Key("up") || F.Key("w")) && sY > 0 && !F.TeclaDesativada("up"))
            {
                sY--;
                F.DesativarTecla("up", 125);
            }
            if ((F.Key("down") || F.Key("s")) && sY < 1 && !F.TeclaDesativada("down"))
            {
                sY++;
                F.DesativarTecla("down", 125);
            }

            for (int m = 0; m < 2; m++)
            {
                cA = (m == mA && mY == -1) ? (byte)35 : (byte)19;

                if (sY == m)
                {
                    cX = 35;
                    cY = 255;

                    if (F.Key("space"))
                    {
                        switch (m)
                        {
                        case 0:
                            state  = 0;
                            state_ = 2;
                            break;

                        case 1:
                            state = 2;
                            CurrentScreen.Change("mainmenu");
                            break;
                        }

                        menu = false;
                        F.DesativarTecla("esc", 300);
                        F.DesativarTecla("space", 300);
                        Efeitos.Backdrop("fade-out", 0, 25);
                    }
                }
                else
                {
                    cX = 19;
                    cY = 130;
                }

                F.DesenharShape(((Screen.width - 240) / 2), (Screen.height / 2) + (80 * m) - 80, 240, 80, cX, cX, cX, 255);
                F.Escrever(e[m], true, ((Screen.width - 240) / 2) + 120 - (F.TxtWidth(e[m], 32, true) / 2), (Screen.height / 2) + 16 + (80 * m) - 80, 32, cY, cY, cY, 230);
            }
        }
Ejemplo n.º 18
0
        public static void TelaPrincipal()
        {
            if (F.Key("esc") && !menu && !F.TeclaDesativada("esc") && state == 2)
            {
                V.backdrop = false;
                menu       = true;
                state      = 1;
                F.DesativarTecla("esc", 300);
                Efeitos.Backdrop("fade-in", 125, 25);
            }

            if (F.Key("shift") && especial_count == 100 && !F.TeclaDesativada("shift") && state == 2)
            {
                for (int i = 0; i < 15; i++)
                {
                    V.objetos.Add(new Player("ally_" + i, 52 * i + 36, Screen.height + 128 + 50, 32, 32));
                }

                especial_count = 0;
                F.DesativarTecla("shift", 300);
            }

            Raid();

            V.window.SetView(V.view);

            foreach (Background x in V.background.ToList())
            {
                x.Draw();
            }

            foreach (Limite x in V.limites.ToList())
            {
                x.Draw();
            }

            foreach (Bullet x in V.bullets.ToList())
            {
                x.Draw();
            }

            foreach (Bonus x in V.bonus.ToList())
            {
                x.Draw();
            }

            foreach (Geral x in V.objetos.ToList())
            {
                x.Draw();
            }

            V.window.SetView(V.hud);

            Configuracoes.Draw();
            F.Escrever("SCORE " + score, true, Screen.width - F.TxtWidth("SCORE " + score, 32, true) - 40, 20, 32, 255, 255, 255, 255, 000, 000, 47, 255, 2);

            if (especial_count > 100)
            {
                especial_count = 100;
            }

            F.DesenharShape(Screen.width - 122, Screen.height - 42, especial_count, 20, 181, 230, 29, 255);

            if (especial && especial_count == 100)
            {
                F.Escrever("Press Shift!", true, Screen.width - F.TxtWidth("Press Shift!", 16, true) - 30, Screen.height - 64, 16, 255, 255, 255, 255, 000, 000, 47, 255, 2);
            }

            if (!F.TeclaDesativada("especial") && especial_count == 100)
            {
                especial = !especial;
                F.DesativarTecla("especial", 1000);
            }
        }
Ejemplo n.º 19
0
 public override void OnStart()
 {
     Efeitos.opacidade = 0;
     Efeitos.Backdrop("fade-in", 255, 2.55f);
 }
Ejemplo n.º 20
0
		public override void OnStart(){
			Efeitos.Backdrop("fade-out", 0, 2.5f);
		}
Ejemplo n.º 21
0
        public static void TelaPrincipal()
        {
            V.window.SetView(V.view);

            foreach (Background x in V.background.ToList())
            {
                x.Draw();
            }

            V.window.SetView(V.hud);

            F.DesenharShape(Screen.width / 2 - F.TxtWidth("Start", 32, false) / 2 - 10, Screen.height - 117, F.TxtWidth("Start", 32, false) + 25, 35, 255, 255, 255, 255);

            F.Escrever("How to play", true, Screen.width / 2 - F.TxtWidth("How to play", 50, true) / 2, 20, 50, 255, 255, 255, 255);
            F.Escrever("Start", true, Screen.width / 2 - F.TxtWidth("Start", 32, true) / 2, Screen.height - 122, 32, 000, 000, 000, 255);
            F.Escrever("v1.0", false, Screen.width - F.TxtWidth("v1.0", 32, false) - 30, Screen.height - 50, 32, 255, 255, 255, 255);

            V.img[0].Scale = new Vector2f(2, 2);

            V.img[0].Texture     = V.IMG_CAT[1][8];
            V.img[0].TextureRect = new IntRect(0, 0, 130, 55);
            V.img[0].Position    = new Vector2f(!V.multiplayer ? Screen.width / 2 - 130 : Screen.width * 0.3f - 130, 200);
            V.window.Draw(V.img[0]);

            V.img[0].Texture     = V.IMG_CAT[1][9];
            V.img[0].TextureRect = new IntRect(0, 0, 48, 37);
            V.img[0].Position    = new Vector2f(!V.multiplayer ? Screen.width / 2 - 130 : Screen.width * 0.3f - 130, 350);
            V.window.Draw(V.img[0]);

            F.Escrever("Move", false, !V.multiplayer ? Screen.width / 2 - 105 : Screen.width * 0.3f - 105, 282, 24, 255, 255, 255, 255);
            F.Escrever("Special", false, !V.multiplayer ? Screen.width / 2 - 110 : Screen.width * 0.3f - 110, 396, 24, 255, 255, 255, 255);
            F.Escrever("Fire", false, !V.multiplayer ? Screen.width / 2 + 30  : Screen.width * 0.3f + 30, 282, 24, 255, 255, 255, 255);

            if (V.multiplayer)
            {
                V.img[0].Texture     = V.IMG_CAT[1][7];
                V.img[0].TextureRect = new IntRect(0, 0, 130, 56);
                V.img[0].Position    = new Vector2f(Screen.width * 0.7f - 130, 200);
                V.window.Draw(V.img[0]);

                F.Escrever("Move", false, Screen.width * 0.7f - 105, 284, 24, 255, 255, 255, 255);
                F.Escrever("Fire", false, Screen.width * 0.7f + 50, 284, 24, 255, 255, 255, 255);

                F.Escrever("Player 1", true, Screen.width * 0.3f - F.TxtWidth("Player 1", 32, true) / 2, 130, 32, 255, 255, 255, 255);
                F.Escrever("Player 2", true, Screen.width * 0.7f - F.TxtWidth("Player 2", 32, true) / 2, 130, 32, 255, 255, 255, 255);
            }

            V.img[0].Scale = new Vector2f(1, 1);

            if (start == 1 && Efeitos.opacidade == 255)
            {
                CurrentScreen.Change("play");
            }

            if (F.Key("space") && !F.TeclaDesativada("space") && start == 0)
            {
                Efeitos.Backdrop("fade-in", 255, 2.5f);

                start = 1;
                F.DesativarTecla("space", 175);
            }

            if (F.Key("esc") && !F.TeclaDesativada("esc") && start == 0)
            {
                CurrentScreen.Change("mainmenu");
                F.DesativarTecla("esc", 175);
            }
        }