Universo Games
Ola , Convidado

Sistema de Climas Logo1110

Você ainda não e cadastrado então cadastre-se e veja todas as atualizações no Mundo RPG!!!
Universo Games
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Universo Games

Suporte e Desenvolvimento só no Universo Games
 
InícioInício  PortalPortal  EventosEventos  PublicaçõesPublicações  Últimas imagensÚltimas imagens  RegistarRegistar  EntrarEntrar  
Ola Convidado, Seja Bem vindo a equipe lhe deseja boa sorte no seu projeto!

 

 Sistema de Climas

Ir para baixo 
AutorMensagem
Convidado
Convidado
Anonymous



Sistema de Climas Empty
MensagemAssunto: Sistema de Climas   Sistema de Climas EmptySáb 05 Nov 2011, 23:03

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:

Citação :
Name:cmbWeather

e na list dela ponha:

Citação :
None
Rain
Snow
Bird
Sand

ao lado da combobox crie 1 label chamada:

Citação :
Caption: Temperatura

dps procure por:

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

em baixo adicione:

Código:
.Weather = 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:
' animação
    If NumAnimations > 0 Then
        For i = 1 To MAX_BYTE
            If AnimInstance(i).Used(1) Then
                BltAnimation i, 1
            End If
        Next
    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

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 MegaUpload:

[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Download via MediaFire:

[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Créditos:
°thalles12 (por criar o sistema)
°jadiel848 (por disponibilizar aqui no Fórum)
Ir para o topo Ir para baixo
Convidado
Convidado
Anonymous



Sistema de Climas Empty
MensagemAssunto: Re: Sistema de Climas   Sistema de Climas EmptySáb 05 Nov 2011, 23:13

ótimo tutorial, +1 cred por postar aqui jadiel.
Ir para o topo Ir para baixo
Convidado
Convidado
Anonymous



Sistema de Climas Empty
MensagemAssunto: Re: Sistema de Climas   Sistema de Climas EmptyDom 06 Nov 2011, 01:49

pig ^^ como eu disse:Só estou aqui para Ajudar...
Ir para o topo Ir para baixo
Conteúdo patrocinado





Sistema de Climas Empty
MensagemAssunto: Re: Sistema de Climas   Sistema de Climas Empty

Ir para o topo Ir para baixo
 
Sistema de Climas
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» Sistema De Vip
» [ALL]Sistema VIP
» [EO]Sistema de Pet
» Sistema Noticias
» Sistema de Amigos

Permissões neste sub-fórumNão podes responder a tópicos
Universo Games :: Criação de Jogos :: Eclipse Origens :: Tutorias-
Ir para: