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


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

Ver o tópico anterior Ver o tópico seguinte Ir para baixo Mensagem [Página 1 de 1]

1Sistema de Climas Empty Sistema de Climas Seg Jun 04, 2012 8:43 pm

Strike
Strike
Membro
Membro

Nome do Sistema: Sistema de Climas
Difículdade: 5/5
Ultiliza-se: Visual Basic 6.0
Abra o Client~Side va na frmEditor_MapProperties e crie 1 ComboBox com:

Name:cmbWeather

e na list dela ponha:

None
Rain
Snow
Bird
Sand

ao lado da combobox crie 1 label chamada:

Caption: Temperatura

dps procure por:

Código:
.BootY = Val(txtBootY.text)

em baixo adicione:

Código:
.Weather = Val(cmbWeather.ListIndex)

dps procure no savemap por:

Código:
Put #f, , MAP.Music

e em baixo adicione:

Código:
Put #f, , MAP.Weather

dps procure no loadmap por:

Código:
Get #f, , MAP.Music

em baixo adicione:

Código:
Get #f, , MAP.Weather

dps na modConstants no final dela adicione:

Código:
' weather
Public Const WEATHER_RAINING As Long = 1
Public Const WEATHER_SNOWING As Long = 2
Public Const WEATHER_BIRD As Long = 3
Public Const WEATHER_SAND As Long = 4
Public Const MAX_RAINDROPS As Long = 200
Public Const MAX_SNOWDROPS As Long = 1000
Public Const MAX_BIRDDROPS As Long = 3
Public Const MAX_SANDDROPS As Long = 6

dps procure por:

Código:
' automation problems
Public ReInitSurfaces As Boolean

em baixo adicione:

Código:
' weather
Public DropSnow(1 To MAX_SNOWDROPS) As DropRec
Public DropRain(1 To MAX_RAINDROPS) As DropRec
Public DropBird(1 To MAX_BIRDDROPS) As DropRec
Public DropSand(1 To MAX_SANDDROPS) As DropRec

dps procure por:

Código:
Public DDS_Bars As DirectDrawSurface7

em baixo adicione:

Código:
Public DDS_Snow As DirectDrawSurface7
Public DDS_Bird As DirectDrawSurface7
Public DDS_Sand As DirectDrawSurface7

se ja tiver isso la ignore...

dps procure por:

Código:
Public DDSD_Bars As DDSURFACEDESC2

em baixo adicione:

Código:
Public DDSD_Snow As DDSURFACEDESC2
Public DDSD_Bird As DDSURFACEDESC2
Public DDSD_Sand As DDSURFACEDESC2

dps procure por:

Código:
If FileExist(App.Path & "\data files\graphics\bars.bmp", True) Then Call InitDDSurf("bars", DDSD_Bars, DDS_Bars)

em baixo adicione:

Código:
    If FileExist(App.Path & "\data files\graphics\snow.bmp", True) Then Call InitDDSurf("snow", DDSD_Snow, DDS_Snow)
    If FileExist(App.Path & "\data files\graphics\bird.bmp", True) Then Call InitDDSurf("bird", DDSD_Bird, DDS_Bird)
    If FileExist(App.Path & "\data files\graphics\sand.bmp", True) Then Call InitDDSurf("sand", DDSD_Sand, DDS_Sand)

dps procure por:

Código:
 DDS_Target = Nothing
    ZeroMemory ByVal VarPtr(DDSD_Target), LenB(DDSD_Target)

em baixo adicione:

Código:
 Set DDS_Snow = Nothing 'neve
    ZeroMemory ByVal VarPtr(DDSD_Snow), LenB(DDSD_Snow)
   
    Set DDS_Bird = Nothing
    ZeroMemory ByVal VarPtr(DDSD_Bird), LenB(DDSD_Bird)
   
    Set DDS_Sand = Nothing
    ZeroMemory ByVal VarPtr(DDSD_Sand), LenB(DDSD_Sand)

no final da modDirectDraw7 adicione:

Código:
Sub BltWeather()
    Dim i As Long, sRECT As RECT

    ' rain
    If Map.Weather = WEATHER_RAINING Then
        Call DDS_BackBuffer.SetForeColor(RGB(12, 40, 96))
        For i = 1 To MAX_RAINDROPS
            With DropRain(i)
                If .Init = True Then
                    ' move o rain
                    .y = .y + .ySpeed
                    ' checar a screen
                    If .y > 480 + 64 Then
                        .y = Rand(0, 100)
                        .y = .y - 100
                        .x = Rand(0, 640 + 64)
                        .ySpeed = Rand(5, 10)
                        .Init = True
                    End If
                    ' draw rain
                    DDS_BackBuffer.DrawLine .x + Camera.Left, .y + Camera.top, .x + Camera.Left, .y + (.ySpeed * 2) + Camera.top
                Else
                    .y = Rand(0, 100)
                    .y = .y - 100
                    .x = Rand(0, 640 + 64)
                    .ySpeed = Rand(5, 10)
                    .Init = True
                End If
            End With
        Next
    End If
   
    ' snow
    If Map.Weather = WEATHER_SNOWING Then
        Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255))
        For i = 1 To MAX_SNOWDROPS
            With DropSnow(i)
                If .Init = True Then
                    ' move o snow
                    .y = .y + .ySpeed
                    .x = .x + .xSpeed
                    ' checar screen
                    If .y > 480 + 64 Then
                        .y = Rand(0, 100) - 100
                        .x = Rand(0, 640 + 64)
                        .ySpeed = Rand(1, 4)
                        .xSpeed = Rand(0, 4) - 2
                    End If
                    ' draw rain
                    With sRECT
                        .top = 0
                        .Bottom = 32
                        .Left = 0
                        .Right = 32
                    End With
                    Engine_BltFast .x + Camera.Left, .y + Camera.top, DDS_Snow, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
                Else
                    .y = Rand(0, 480)
                    .x = Rand(0, 640 + 64)
                    .ySpeed = Rand(1, 4)
                    .xSpeed = Rand(0, 4) - 2
                    .Init = True
                End If
            End With
        Next
    End If
   
    If Map.Weather = WEATHER_BIRD Then
        'Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255))
        For i = 1 To MAX_BIRDDROPS
            With DropBird(i)
                If .Init = True Then
                    ' move o snow
                    .y = .y + .ySpeed
                    .x = .x + .xSpeed
                    ' checar a screen
                    If .y > 480 + 64 Then
                        .y = Rand(0, 100) - 100
                        .x = Rand(0, 640 + 64)
                        .ySpeed = Rand(1, 4)
                        .xSpeed = Rand(0, 4) - 2
                    End If
                    ' draw rain
                    With sRECT
                        .top = 0
                        .Bottom = 32
                        .Left = 0
                        .Right = 32
                    End With
                    Engine_BltFast .x + Camera.Left, .y + Camera.top, DDS_Bird, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
                Else
                    .y = Rand(0, 480)
                    .x = Rand(0, 640 + 64)
                    .ySpeed = Rand(1, 4)
                    .xSpeed = Rand(0, 4) - 2
                    .Init = True
                End If
            End With
        Next
    End If
   
    If Map.Weather = WEATHER_SAND Then 'neve
        'Call DDS_BackBuffer.SetForeColor(RGB(255, 255, 255))
        For i = 1 To MAX_SANDDROPS
            With DropSand(i)
                If .Init = True Then
                    ' move o snow
                    .y = .y + .ySpeed
                    .x = .x + .xSpeed
                    ' checkar a screen
                    If .y > 480 + 64 Then
                        .y = Rand(0, 100) - 100
                        .x = Rand(0, 640 + 64)
                        .ySpeed = Rand(1, 4)
                        .xSpeed = Rand(0, 4) - 2
                    End If
                    ' draw rain
                    With sRECT
                        .top = 0
                        .Bottom = 32
                        .Left = 0
                        .Right = 32
                    End With
                    Engine_BltFast .x + Camera.Left, .y + Camera.top, DDS_Sand, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
                Else
                    .y = Rand(0, 480)
                    .x = Rand(0, 640 + 64)
                    .ySpeed = Rand(1, 4)
                    .xSpeed = Rand(0, 4) - 2
                    .Init = True
                End If
            End With
        Next
    End If
End Sub

na modDirectDraw7 procure por:

Código:
' blit out a square at mouse cursor
    If InMapEditor Then
        If frmEditor_Map.optBlock.Value = True Then
            For x = TileView.Left To TileView.Right
                For y = TileView.top To TileView.Bottom
                    If IsValidMapPoint(x, y) Then
                        Call BltDirection(x, y)
                    End If
                Next
            Next
        End If
        Call BltTileOutline
    End If

em baixo adicione:

Código:
' weather
    BltWeather

dps procure por:

Código:
MAP.Music = Buffer.ReadString

em baixo adicione:

Código:
MAP.Weather = Buffer.ReadLong

dps procure por:

Código:
Music As String * NAME_LENGTH

em baixo adicione:

'Lembrese de dar 1 enter em baixo da music para ficar 1 espaço

Código:
Weather As Long

dps procure por:

Código:
Public Type ButtonRec
    fileName As String
    state As Byte
End Type

em baixo adicione:

Código:
Type DropRec
    x As Long
    y As Long
    ySpeed As Long
    xSpeed As Long
    Init As Boolean
End Type

dps procure por:

Código:
Buffer.WriteString Trim$(.Music)

em baixo adicione:

Código:
Buffer.WriteLong .Weather

dps procure por:

Código:
.txtBootY.text = CStr(MAP.BootY)

em baixo add:

Código:
.cmbWeather.ListIndex = CStr(MAP.Weather)

Client~Side terminado agora no Server~Side procure no savemap por:

Código:
Put #F, , MAP(MapNum).Music

em baixo adicione:

Código:
Put #F, , MAP(MapNum).Weather

dps procure no loadmaps por:

Código:
Get #F, , MAP(i).Music

em baixo adicione:

Código:
Get #F, , MAP(i).Weather

dps procure por:

Código:
MAP(MapNum).Music = Buffer.ReadString

em baixo adicione:

Código:
MAP(MapNum).Weather = Buffer.ReadLong

dps procure por:

Código:
Buffer.WriteString Trim$(MAP(MapNum).Music)

em baixo adicione:

Código:
Buffer.WriteLong MAP(MapNum).Weather

dps procure por :

Código:
Music As String * NAME_LENGTH

em baixo adicione:
De 2 enter e adicione:

Código:
Weather As Long


Finalmente acabo e.e

OBS:caso tenha algum mapa criado ele tem q ser deletado se não vai dar erro !
OBS2: PRECISA BAIXAR ISSO ABAIXO E POR NA PASTA GRAPHICS DO TEU JOGO

Download via MediaFire:

http://www.mediafire.com/?ebqb6z4j28qbbi8

Créditos:
°thales12

Ver o tópico anterior Ver o tópico seguinte Ir para o topo Mensagem [Página 1 de 1]

Tópicos semelhantes

-

» Sistema de Titulos
» Sistema de Guild

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