viewing: Veil Online

  • Time Posted:
    3 months ago
  • Language:
    vb
  • Views
    44
  • Privacy
    Public
Private Sub PicMap_KeyDown(KeyCode As Integer, Shift As Integer)
If HALTmov = True Then Exit Sub 'If you not allowed to move dont take any input
If KeyCode = vbKeyUp Then 'These are pretty self explanitory if u press up Move up lol
    If MAP(PlayerX, PlayerY - 1).Blocked = 1 Then Exit Sub 'Check Up block
    If MAP(PlayerX, PlayerY - 1).Teleport = 1 Then
    OPENMAP (MAP(PlayerX, PlayerY - 1).TeleMap)
    PlayerX = 100
    PlayerY = 100
    End If
    OffsetY = OffsetY - 1 'Move
    PlayerDir = 0
End If
 
If KeyCode = vbKeyDown Then
If MAP(PlayerX, PlayerY + 1).Blocked = 1 Then Exit Sub 'Check Down Block
If MAP(PlayerX, PlayerY + 1).Teleport = 1 Then
OPENMAP (MAP(PlayerX, PlayerY + 1).TeleMap)
End If
OffsetY = OffsetY + 1 'Move
PlayerDir = 1
End If
 
If KeyCode = vbKeyLeft Then
If MAP(PlayerX - 1, PlayerY).Blocked = 1 Then Exit Sub 'Check Left Block
OffsetX = OffsetX - 1 'Move
PlayerDir = 2
End If
 
If KeyCode = vbKeyRight Then
If MAP(PlayerX + 1, PlayerY).Blocked = 1 Then Exit Sub 'Check Right Block
OffsetX = OffsetX + 1 'Move
PlayerDir = 3
End If
 
If OffsetX < -5 Then OffsetX = -5 'because -5 willset player at center (since he is 5 tiles in the middle)
If OffsetY < -5 Then OffsetY = -5 'because -5 willset player at center (since he is 5 tiles in the middle)
If OffsetX > 195 Then OffsetX = 195 'Same as above but this is just for the map boundry on the other side
If OffsetY > 195 Then OffsetY = 195 'Same as above but this is just for the map boundry on the other side
Label1.Caption = OffsetX
Label2.Caption = OffsetY
frmSck.wsck.SendData "PLAYERPOS|?|" & OffsetX & "|?|" & OffsetY
Refresh_Screen 'Redraw the screen
End Sub

latest pastes