Movimentação Wasd e Setas V2.0
2 participantes
:: Eclipse Origins :: Tutoriais
Página 1 de 1
Movimentação Wasd e Setas V2.0
no frmMain Crie um CheckBox com as seguintes configuraçoes
Nome : chkMov
Caption : Andar com setas
Depois procure por:
Troque toda por
Creditos : Eduardo
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- Admin
- Mensagens : 12
Agradecimentos : 2
Data de inscrição : 22/08/2012
Idade : 27
Re: Movimentação Wasd e Setas V2.0
Bom e Simples, Parabéns Edu.
+1 Continue assim
Atenciosamente ~
Eu
+1 Continue assim
Atenciosamente ~
Eu
Myke ~- Novato
- Mensagens : 7
Agradecimentos : -1
Data de inscrição : 10/10/2012
:: Eclipse Origins :: Tutoriais
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
Seg Abr 08, 2013 7:18 pm por L Mars
» PlayGame chego !!
Qua Out 17, 2012 1:59 pm por PlayGame
» Dragon Ball Z Moster Online
Ter Out 16, 2012 8:19 pm por Myke ~
» [EEB]Sistema de Guerra ninja Basic Por ComandButton
Ter Out 16, 2012 8:14 pm por Myke ~
» Meus tutorias
Dom Out 14, 2012 4:55 pm por PlayGame
» Avaliem esse's desenho
Dom Out 14, 2012 4:36 pm por PlayGame
» Tutorial Mapper - Como avaliar um mapa
Sáb Out 13, 2012 4:52 pm por NeeTo
» Movimentação Wasd e Setas V2.0
Qui Out 11, 2012 6:14 pm por Myke ~
» Level Maximo 1000
Qui Out 11, 2012 6:10 pm por Myke ~