Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scrolling maps (Not 100% Working)
#15
Okay, then add this code, somewhere in gameloop:

Code:
If Map.Up = 0 Then
              If MapYOffset > 0 Or (MapYOffset = 0 And GetPlayerDir(MyIndex) = DIR_DOWN) Then
                  MapYOffset = 0
                  PYOffset = 32
              End If
        End If
        If Map.Down = 0 Then
              If MapYOffset < 0 Or (MapYOffset = 0 And GetPlayerDir(MyIndex) = DIR_UP) Then
                  MapYOffset = 0
                  PYOffset = 32
              End If
        End If
        If Map.Left = 0 Then
              If MapXOffset > 0 Or (MapXOffset = 0 And GetPlayerDir(MyIndex) = DIR_RIGHT) Then
                  MapXOffset = 0
                  PXOffset = 32
              End If
        End If
        If Map.Right = 0 Then
              If MapXOffset < 0 Or (MapXOffset = 0 And GetPlayerDir(MyIndex) = DIR_LEFT) Then
                  MapXOffset = 0
                  PXOffset = 32
              End If
         End If

This will make it stop scrolling, if there is no map linked in any direction.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)