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



 
InícioÚltimas imagensProcurarRegistarEntrar
Os que mais criam tópicos
Sonart
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Alenaldo
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Over~
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Warrior
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Caio~
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
SSO
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
newbie123
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Kaue
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Jim
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
yuri godinho
Andar Com o mouse I_vote_lcapAndar Com o mouse I_voting_barAndar Com o mouse I_vote_rcap 
Entrar
Nome de usuário:
Senha:
Entrar automaticamente: 
:: Esqueci-me da senha

 

 Andar Com o mouse

Ir para baixo 
AutorMensagem
Over~
Moderador.G
Moderador.G
Over~


Mensagens : 149
Moeda : 214
Pontos : 11
Data de inscrição : 04/01/2013

Andar Com o mouse Empty
MensagemAssunto: Andar Com o mouse   Andar Com o mouse Icon_minitimeSex Jan 04, 2013 3:11 pm

olá pessoal hoje irei disponibilizar o tutorial de andar com o mouse ele funciona ao você clicar em alguma parte da tela do jogo ir andando até ela.

Client-Side

Citação :
Faça um novo check lá no picOptions com essas configurações:



Código:
Caption = Andar Com Mouse


Agora clica duas vezes no Check e poe esse codigo.

Código:
Call PutVar(App.Path & "\config.ini", "CONFIG", "MouseMovement", Check1.Value)


mais antes verifique se o nome do check está "Check1".

Agora no modgamelogic no fim ponha essa nova função:

Código:
Public Function MouseCheck() As Boolean

If Val(GetVar(App.Path & "\config.ini", "CONFIG", "MouseMovement")) = 1 Then
MouseCheck = True
Else
MouseCheck = False
End If
End Function

agora vá no frmMirage e axe:

Código:
Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

Ai troque tudo por:

Código:

Dim I As Long

If InSpawnEditor Then
If SpawnLocator > 0 Then
TempNpcSpawn(SpawnLocator).Used = 1
TempNpcSpawn(SpawnLocator).x = Int((x + (NewPlayerX * PIC_X)) / PIC_X)
TempNpcSpawn(SpawnLocator).y = Int((y + (NewPlayerY * PIC_Y)) / PIC_Y)
frmMapProperties.Spawn(SpawnLocator - 1).Caption = "(" & TempNpcSpawn(SpawnLocator).x & ", " & TempNpcSpawn(SpawnLocator).y & ")"
SpawnLocator = 0
End If

Exit Sub
End If

If (Button = 1 Or Button = 2) And InEditor = True Then
Call EditorMouseDown(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If

If MouseCheck = True Then
If Button = 1 And InEditor = False Then
ControlDown = True
Call CheckAttack
End If
End If

If MouseCheck = False Then
If Button = 1 And InEditor = False Then
ControlDown = False
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If MouseCheck = False Then
If Button = 2 Then
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If (Button = 1 Or Button = 2) And InEditor = False Then
If Button = 1 And Player(MyIndex).Pet.Alive = YES Then
Call PetMove(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If

If MouseCheck = True Then
If Button = 2 Then
XToGo = (x + (NewPlayerX * PIC_X)) / PIC_X
YToGo = (y + (NewPlayerY * PIC_Y)) / PIC_Y
Call CheckMapGetItem
End If
End If

If MouseCheck = True Then
If Button = 1 Then
Call PlayerSearch(Button, Shift, (x + (NewPlayerX * PIC_X)), (y + (NewPlayerY * PIC_Y)))
End If
End If


Novamente no modGamelogic axe:

Código:
Public MouseX As Long
Public MouseY As Long


Embaixo ponha:

Código:
Public XToGo As Long
Public YToGo As Long

axe no modGamelogic:

Código:
' Blit the backbuffer
Call DD_PrimarySurf.Blt(rec_pos, DD_BackBuffer, rec, DDBLT_WAIT)

embaixo ponha:

Código:
If XToGo <> -1 Or YToGo <> -1 Then
Dim XDif As Long
Dim YDif As Long

XDif = Abs(GetPlayerX(MyIndex) - XToGo)
YDif = Abs(GetPlayerY(MyIndex) - YToGo)

If XToGo = GetPlayerX(MyIndex) Or XToGo = -1 Then
XToGo = -1
XDif = 0
Else
XDif = Abs(GetPlayerX(MyIndex) - XToGo)
End If

If YToGo = GetPlayerY(MyIndex) Or YToGo = -1 Then
YToGo = -1
YDif = 0
Else
YDif = Abs(GetPlayerY(MyIndex) - YToGo)
End If

Debug.Print (XDif & " " & YDif)

If XDif > YDif Then
If GetPlayerX(MyIndex) - XToGo > 0 Then
DirLeft = True
Else
DirRight = True
End If
End If

If YDif > XDif Then
If GetPlayerY(MyIndex) - YToGo > 0 Then
DirUp = True
Else
DirDown = True
End If
End If

If XDif = YDif And XDif <> 0 And YDif <> 0 Then
' I'll be nice and give you the non-directional movement code
'If Int(Rnd * 2) = 0 Then
If GetPlayerX(MyIndex) - XToGo > 0 Then
DirLeft = True
Else
DirRight = True
End If
' Else
If GetPlayerY(MyIndex) - YToGo > 0 Then
DirUp = True
Else
DirDown = True
End If
'End If
End If
End If

ache:

Código:
Sub CheckInput(ByVal KeyState As Byte, ByVal KeyCode As Integer, ByVal Shift As Integer)

ai troque tudo por:

Código:
Código:
If GettingMap = False Then
If KeyState = 1 Then
If KeyCode = vbKeyReturn Then
Call CheckMapGetItem
End If
If KeyCode = vbKeyControl Then
ControlDown = True
End If
If KeyCode = vbKeyUp Then
DirUp = True
DirDown = False
DirLeft = False
DirRight = False
End If
If KeyCode = vbKeyDown Then
DirUp = False
DirDown = True
DirLeft = False
DirRight = False
End If
If KeyCode = vbKeyLeft Then
DirUp = False
DirDown = False
DirLeft = True
DirRight = False
End If
If KeyCode = vbKeyRight Then
DirUp = False
DirDown = False
DirLeft = False
DirRight = True
End If
If KeyCode = vbKeyShift Then
ShiftDown = True
End If
Else
If KeyCode = vbKeyUp Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyDown Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyLeft Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyRight Then
XToGo = -1
YToGo = -1
End If
If KeyCode = vbKeyShift Then ShiftDown = False
If KeyCode = vbKeyControl Then ControlDown = False
End If
End If


em modClientTCP na Sub TcpInit() ali em baixo onde tem PlayerBuffer = "" em baixo ponha:

Código:
XToGo = -1
YToGo = -1.
Cool
Créditos:
Lucas Lôpo
Over~.
Ir para o topo Ir para baixo
 
Andar Com o mouse
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» Mouse tremer

Permissões neste sub-fórumNão podes responder a tópicos
 :: Desenvolvimento de Jogos :: Engines :: Elysium Diamond :: Tutoriais-
Ir para: