Conexão Maker

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

    Mapa com Animação

    Thales12
    Thales12
    Administrador
    Administrador


    Mensagens : 140
    Level : 8
    Data de inscrição : 01/11/2011
    Idade : 29
    Localização : Rio de Janeiro

    Mapa com Animação Empty Mapa com Animação

    Mensagem por Thales12 Qua Fev 15, 2012 2:12 am


    Enfim, vocês falaram muito(Ricardo e Ian), só enchendo linguiça e etc --', não vai da lag(possivelmente coma alguns FPS da GameLoop), porem, não chega a ser tanto(i think), enfim, está aqui o Tuto(Eu que fiz agora rs').

    Não é muito difícil, segue o tutorial(criado por min rs'):

    Client~Side :

    procure por:

    Código:
    ' Layers in a map
    Public Enum MapLayer
        Ground = 1
        Mask
        Mask2
        Fringe
        Fringe2
        ' Make sure Layer_Count is below everything else
        Layer_Count
    End Enum

    Troque por:

    Código:
    ' Layers in a map
    Public Enum MapLayer
        Ground = 1
        Mask
        Mask2
        Fringe
        Fringe2
        Anim
        ' Make sure Layer_Count is below everything else
        Layer_Count
    End Enum

    No ModDirectDraw7 procure por essa sub:

    Código:
    Public Sub BltMapTile(ByVal x As Long, ByVal y As Long)

    Troque ela toda por essa:

    Código:
    Public Sub BltMapTile(ByVal x As Long, ByVal y As Long)
    Dim rec As DxVBLib.RECT
    Dim i As Long
       
        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler

        With Map.Tile(x, y)
            For i = MapLayer.Ground To MapLayer.Anim
                ' skip tile?
                If (.Layer(i).Tileset > 0 And .Layer(i).Tileset <= NumTileSets) And (.Layer(i).x > 0 Or .Layer(i).y > 0) Then
                    ' sort out rec
                    rec.top = .Layer(i).y * PIC_Y
                    rec.Bottom = rec.top + PIC_Y
                    rec.Left = .Layer(i).x * PIC_X
                    rec.Right = rec.Left + PIC_X
                    ' render
                    If i = 6 Then
                        If MapAnim > 0 Then
                            Call Engine_BltFast(ConvertMapX(x * PIC_X), ConvertMapY(y * PIC_Y), DDS_Tileset(.Layer(i).Tileset), rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                        End If
                    Else
                        Call Engine_BltFast(ConvertMapX(x * PIC_X), ConvertMapY(y * PIC_Y), DDS_Tileset(.Layer(i).Tileset), rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                    End If
                End If
            Next
        End With
       
        ' Error handler
        Exit Sub
       
    errorhandler:
        HandleError "BltMapTile", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub

    No frmEditor_Map adicione um "optLayer" novo, ele vai ser o "optLayer(6)" 6 = array, nomeio de "Anim"

    Parte Cliente~Side pronta, agora vamos para o Server~Side:

    Procure por:

    Código:
    ' Layers in a map
    Public Enum MapLayer
        Ground = 1
        Mask
        Mask2
        Fringe
        Fringe2
        ' Make sure Layer_Count is below everything else
        Layer_Count
    End Enum

    Mude Para:

    Código:
    ' Layers in a map
    Public Enum MapLayer
        Ground = 1
        Mask
        Mask2
        Fringe
        Fringe2
        Anim
        ' Make sure Layer_Count is below everything else
        Layer_Count
    End Enum

    Agora delete todos os mapas e teste.

    qual quer erro informe, pois fiz agora XD.

    Créditos: OmegaZero pelo sistema e tutorial.
    Créditos: Thales12 por fazer o tuto e postar.

      Data/hora atual: Sex Mar 29, 2024 4:57 am