Em pedido de Marakgarin
Cliente~Side
Procure:
Abaixo ponha:
Simples, rápido, fácil.
Créditos; Renanr.
Cliente~Side
Procure:
- Código:
Sub ProcessMovement(ByVal Index As Long)
Dim MovementSpeed As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
' Check if player is walking, and if so process moving them over
Select Case Player(Index).Moving
Case MOVING_WALKING: MovementSpeed = ((ElapsedTime / 1000) * (RUN_SPEED * SIZE_X))
Case MOVING_RUNNING: MovementSpeed = ((ElapsedTime / 1000) * (WALK_SPEED * SIZE_X))
Case Else: Exit Sub
End Select
Select Case GetPlayerDir(Index)
Case DIR_UP
Player(Index).YOffset = Player(Index).YOffset - MovementSpeed
If Player(Index).YOffset < 0 Then Player(Index).YOffset = 0
Case DIR_DOWN
Player(Index).YOffset = Player(Index).YOffset + MovementSpeed
If Player(Index).YOffset > 0 Then Player(Index).YOffset = 0
Case DIR_LEFT
Player(Index).XOffset = Player(Index).XOffset - MovementSpeed
If Player(Index).XOffset < 0 Then Player(Index).XOffset = 0
Case DIR_RIGHT
Player(Index).XOffset = Player(Index).XOffset + MovementSpeed
If Player(Index).XOffset > 0 Then Player(Index).XOffset = 0
End Select
' Check if completed walking over to the next tile
If Player(Index).Moving > 0 Then
If GetPlayerDir(Index) = DIR_RIGHT Or GetPlayerDir(Index) = DIR_DOWN Then
If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then
Player(Index).Moving = 0
If Player(Index).Step = 1 Then
Player(Index).Step = 3
Else
Player(Index).Step = 1
End If
End If
Else
If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then
Player(Index).Moving = 0
If Player(Index).Step = 1 Then
Player(Index).Step = 3
Else
Player(Index).Step = 1
End If
End If
End If
End If
Abaixo ponha:
- Código:
CheckMapGetItem
Simples, rápido, fácil.
Créditos; Renanr.