Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.
Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.

Você não está conectado. Conecte-se ou registre-se

Mapa com Animação

Ir para baixo  Mensagem [Página 1 de 1]

1Mapa com Animação Empty Mapa com Animação Dom Fev 19, 2012 8:25 pm

thales12

thales12
Moderador Global
Moderador Global


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.

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos