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

Movimentação Wasd e Setas V2.0

2 participantes

Ir para baixo

Movimentação Wasd e Setas V2.0 Empty Movimentação Wasd e Setas V2.0

Mensagem  Eduardo Qui Out 11, 2012 4:46 am

no frmMain Crie um CheckBox com as seguintes configuraçoes

Nome : chkMov
Caption : Andar com setas

Depois procure por:

Código:
Public Sub CheckInputKeys()

Troque toda por

Código:
Public Sub CheckInputKeys()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler

If GetKeyState(vbKeyShift) < 0 Then
ShiftDown = True
Else
ShiftDown = False
End If

If GetKeyState(vbKeyReturn) < 0 Then
CheckMapGetItem
End If

If GetKeyState(vbKeyControl) < 0 Then
ControlDown = True
Else
ControlDown = False
End If

If frmMain.chkMov.Value = YES Then
frmMain.txtMyChat.Locked = NO
If GetKeyState(vbKeyUp) < 0 Then
DirUp = True
DirDown = False
DirLeft = False
DirRight = False
Exit Sub
Else
DirUp = False
End If

'Move Right
If GetKeyState(vbKeyRight) < 0 Then
DirUp = False
DirDown = False
DirLeft = False
DirRight = True
Exit Sub
Else
DirRight = False
End If

'Move down
If GetKeyState(vbKeyDown) < 0 Then
DirUp = False
DirDown = True
DirLeft = False
DirRight = False
Exit Sub
Else
DirDown = False
End If

'Move left
If GetKeyState(vbKeyLeft) < 0 Then
DirUp = False
DirDown = False
DirLeft = True
DirRight = False
Exit Sub
Else
DirLeft = False
End If
End If

If frmMain.chkMov.Value = NO Then
frmMain.txtMyChat.Locked = YES
If GetKeyState(vbKeyW) < 0 Then
DirUp = True
DirDown = False
DirLeft = False
DirRight = False
Exit Sub
Else
DirUp = False
End If

'Move Right
If GetKeyState(vbKeyD) < 0 Then
DirUp = False
DirDown = False
DirLeft = False
DirRight = True
Exit Sub
Else
DirRight = False
End If

'Move down
If GetKeyState(vbKeyS) < 0 Then
DirUp = False
DirDown = True
DirLeft = False
DirRight = False
Exit Sub
Else
DirDown = False
End If

'Move left
If GetKeyState(vbKeyA) < 0 Then
DirUp = False
DirDown = False
DirLeft = True
DirRight = False
Exit Sub
Else
DirLeft = False
End If
End If

' Error handler
Exit Sub
errorhandler:
HandleError "CheckInputKeys", "modInput", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Creditos : Eduardo


Última edição por Eduardo em Qui Out 11, 2012 7:48 pm, editado 1 vez(es)
Eduardo
Eduardo
Admin

Mensagens : 12
Agradecimentos : 2
Data de inscrição : 22/08/2012
Idade : 27

Ir para o topo Ir para baixo

Movimentação Wasd e Setas V2.0 Empty Re: Movimentação Wasd e Setas V2.0

Mensagem  Myke ~ Qui Out 11, 2012 6:14 pm

Bom e Simples, Parabéns Edu.

+1 Continue assim

Atenciosamente ~
Eu

Myke ~
Novato
Novato

Mensagens : 7
Agradecimentos : -1
Data de inscrição : 10/10/2012

Ir para o topo Ir para baixo

Ir para o topo


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