Beispiel #1
0
    public static void Player_Name(byte Index, int x, int y)
    {
        Texture Texture   = Tex_Character[Player.Character_Texture(Index)];
        int     Name_Size = Tools.MeasureText_Width(Lists.Player[Index].Name);

        // Position do Text
        Point Position = new Point();

        Position.X = x + MySize(Texture).Width / Jogo.Animation_Amount / 2 - Name_Size / 2;
        Position.Y = y - MySize(Texture).Height / Jogo.Animation_Amount / 2;

        // Cor do Text
        SFML.Graphics.Color Cor;
        if (Index == Player.MyIndex)
        {
            Cor = SFML.Graphics.Color.Yellow;
        }
        else
        {
            Cor = SFML.Graphics.Color.White;
        }

        // Desenha o Text
        Desenhar(Lists.Player[Index].Name, Jogo.ConvertX(Position.X), Jogo.ConvertY(Position.Y), Cor);
    }
Beispiel #2
0
    public static void NPC_Name(byte Index, int x, int y)
    {
        Point   Position = new Point(); SFML.Graphics.Color Cor;
        short   NPC_Num   = Lists.Map.Temp_NPC[Index].Index;
        int     Name_Size = Tools.MeasureText_Width(Lists.NPC[NPC_Num].Name);
        Texture Texture   = Tex_Character[Lists.NPC[NPC_Num].Texture];

        // Position do Text
        Position.X = x + MySize(Texture).Width / Jogo.Animation_Amount / 2 - Name_Size / 2;
        Position.Y = y - MySize(Texture).Height / Jogo.Animation_Amount / 2;

        // Cor do Text
        switch ((Jogo.NPCs)Lists.NPC[NPC_Num].Type)
        {
        case Jogo.NPCs.Passivo: Cor = SFML.Graphics.Color.White; break;

        case Jogo.NPCs.Atacado: Cor = SFML.Graphics.Color.Red; break;

        case Jogo.NPCs.AoVer: Cor = new SFML.Graphics.Color(228, 120, 51); break;

        default: Cor = SFML.Graphics.Color.White; break;
        }

        // Desenha o Text
        Desenhar(Lists.NPC[NPC_Num].Name, Jogo.ConvertX(Position.X), Jogo.ConvertY(Position.Y), Cor);
    }
Beispiel #3
0
    public static void Player_Character(byte Index)
    {
        byte  Coluna = Jogo.Animation_Stop;
        int   x, y;
        short x2 = Lists.Player[Index].X2, y2 = Lists.Player[Index].Y2;
        bool  Suffering = false;
        short Texture   = Player.Character_Texture(Index);

        // Previni sobrecargas
        if (Texture <= 0 || Texture > Tex_Character.GetUpperBound(0))
        {
            return;
        }

        // Define a Animation
        if (Lists.Player[Index].Atacando && Lists.Player[Index].Attack_Time + Jogo.Attack_Velocity / 2 > Environment.TickCount)
        {
            Coluna = Jogo.Animation_Attack;
        }
        else
        {
            if (x2 > 8 && x2 < Jogo.Grade)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (x2 < -8 && x2 > Jogo.Grade * -1)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (y2 > 8 && y2 < Jogo.Grade)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (y2 < -8 && y2 > Jogo.Grade * -1)
            {
                Coluna = Lists.Player[Index].Animation;
            }
        }

        // Demonstra que o Character está Suffering dano
        if (Lists.Player[Index].Suffering > 0)
        {
            Suffering = true;
        }

        // Desenha o Player
        x = Lists.Player[Index].X * Jogo.Grade + Lists.Player[Index].X2;
        y = Lists.Player[Index].Y * Jogo.Grade + Lists.Player[Index].Y2;
        Character(Texture, new Point(Jogo.ConvertX(x), Jogo.ConvertY(y)), Lists.Player[Index].Direction, Coluna, Suffering);
        Player_Name(Index, x, y);
        Player_Bars(Index, x, y);
    }
Beispiel #4
0
    public static void Map_Items()
    {
        // Desenha todos osItems que estão no chão
        for (byte i = 1; i <= Lists.Map.Temp_Item.GetUpperBound(0); i++)
        {
            Lists.Structures.Map_Items Data = Lists.Map.Temp_Item[i];

            // Somente se necessário
            if (Data.Index == 0)
            {
                continue;
            }

            // Desenha o item
            Point Position = new Point(Jogo.ConvertX(Data.X * Jogo.Grade), Jogo.ConvertY(Data.Y * Jogo.Grade));
            Desenhar(Tex_Item[Lists.Item[Data.Index].Texture], Position);
        }
    }
Beispiel #5
0
    public static void Player_Bars(byte Index, int x, int y)
    {
        Size  Character_Size = MySize(Tex_Character[Player.Character_Texture(Index)]);
        Point Position       = new Point(Jogo.ConvertX(x), Jogo.ConvertY(y) + Character_Size.Height / Jogo.Animation_Amount + 4);
        int   Width_Complete = Character_Size.Width / Jogo.Animation_Amount;
        short Contagem       = Lists.Player[Index].Vital[(byte)Jogo.Vital.Life];

        // Apenas se necessário
        if (Contagem <= 0 || Contagem >= Lists.Player[Index].Max_Vital[(byte)Jogo.Vital.Life])
        {
            return;
        }

        // Cálcula a Width da barra
        int Width = (Contagem * Width_Complete) / Lists.Player[Index].Max_Vital[(byte)Jogo.Vital.Life];

        // Desenha as Bars
        Desenhar(Tex_Bars, Position.X, Position.Y, 0, 4, Width_Complete, 4);
        Desenhar(Tex_Bars, Position.X, Position.Y, 0, 0, Width, 4);
    }
Beispiel #6
0
    public static void NPC_Bars(byte Index, int x, int y)
    {
        Lists.Structures.Map_NPCs NPC = Lists.Map.Temp_NPC[Index];
        int     Name_Size             = Tools.MeasureText_Width(Lists.NPC[NPC.Index].Name);
        Texture Texture = Tex_Character[Lists.NPC[NPC.Index].Texture];
        short   Valor   = NPC.Vital[(byte)Jogo.Vital.Life];

        // Apenas se necessário
        if (Valor <= 0 || Valor >= Lists.NPC[NPC.Index].Vital[(byte)Jogo.Vital.Life])
        {
            return;
        }

        // Position
        Point Position       = new Point(Jogo.ConvertX(x), Jogo.ConvertY(y) + MySize(Texture).Height / Jogo.Animation_Amount + 4);
        int   Width_Complete = MySize(Texture).Width / Jogo.Animation_Amount;
        int   Width          = (Valor * Width_Complete) / Lists.NPC[NPC.Index].Vital[(byte)Jogo.Vital.Life];

        // Desenha a barra
        Desenhar(Tex_Bars, Position.X, Position.Y, 0, 4, Width_Complete, 4);
        Desenhar(Tex_Bars, Position.X, Position.Y, 0, 0, Width, 4);
    }
Beispiel #7
0
    public static void Map_Tiles(byte c)
    {
        // Previni erros
        if (Lists.Map.Name == null)
        {
            return;
        }

        // Data
        System.Drawing.Color TempCor = System.Drawing.Color.FromArgb(Lists.Map.Coloração);
        SFML.Graphics.Color  Cor     = CCor(TempCor.R, TempCor.G, TempCor.B);

        // Desenha todas as Layers dos Tiles
        for (short x = (short)Jogo.Tiles_View.X; x <= Jogo.Tiles_View.Width; x++)
        {
            for (short y = (short)Jogo.Tiles_View.Y; y <= Jogo.Tiles_View.Height; y++)
            {
                if (!Map.ForaDoLimite(x, y))
                {
                    for (byte q = 0; q <= Lists.Map.Tile[x, y].Data.GetUpperBound(1); q++)
                    {
                        if (Lists.Map.Tile[x, y].Data[c, q].Tile > 0)
                        {
                            int x2 = Lists.Map.Tile[x, y].Data[c, q].x * Jogo.Grade;
                            int y2 = Lists.Map.Tile[x, y].Data[c, q].y * Jogo.Grade;

                            // Desenha o Tile
                            if (!Lists.Map.Tile[x, y].Data[c, q].Automático)
                            {
                                Desenhar(Tex_Tile[Lists.Map.Tile[x, y].Data[c, q].Tile], Jogo.ConvertX(x * Jogo.Grade), Jogo.ConvertY(y * Jogo.Grade), x2, y2, Jogo.Grade, Jogo.Grade, Cor);
                            }
                            else
                            {
                                Maps_AutoCriação(new Point(Jogo.ConvertX(x * Jogo.Grade), Jogo.ConvertY(y * Jogo.Grade)), Lists.Map.Tile[x, y].Data[c, q], Cor);
                            }
                        }
                    }
                }
            }
        }
    }