Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seamless Scrolling Maps & Paperdolling.
#18
You got ultra mixed up.. And Dave didn't help. Tongue

Code:
Sub LoadSurroundingMaps()
    Dim MapNum As Long
    Dim BlankMap As MapRec
    Dim i As Byte

    ReDim SMaps(7)
    
    ReDim BlankMap.Tile(0 To MAX_MAPX, 0 To MAX_MAPY)
    
    MapNum = Map.Up
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 0)
    Else
        SMaps(0) = BlankMap
    End If
    MapNum = Map.Right
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 2)
    Else
        SMaps(2) = BlankMap
    End If
    MapNum = Map.Down
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 4)
    Else
        SMaps(4) = BlankMap
    End If
    MapNum = Map.Left
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 6)
    Else
        SMaps(6) = BlankMap
    End If
    MapNum = SMaps(0).Right
    If MapNum = 0 And SMaps(2).Up > 0 Then MapNum = SMaps(2).Up
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 1)
    Else
        SMaps(1) = BlankMap
    End If
    MapNum = SMaps(2).Down
    If MapNum = 0 And SMaps(4).Right > 0 Then MapNum = SMaps(4).Right
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 3)
    Else
        SMaps(3) = BlankMap
    End If
    MapNum = SMaps(4).Left
    If MapNum = 0 And SMaps(6).Down > 0 Then MapNum = SMaps(6).Down
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 5)
    Else
        SMaps(5) = BlankMap
    End If
    MapNum = SMaps(6).Up
    If MapNum = 0 And SMaps(0).Left > 0 Then MapNum = SMaps(0).Left
    If MapNum > 0 Then
        Call iLoadMap(MapNum, 7)
    Else
        SMaps(7) = BlankMap
    End If
End Sub

Thats my loadsurroundingmaps sub. Works.

As for the other stuff.. Wrong sub. xD

In
Code:
Sub Main

At the top, use this:

Code:
Sub Main()
Dim i As Long
Dim a As Long

Call CheckFile

ReDim SMaps(7)

For a = 0 To 7
ReDim SMaps(a).Tile(0 To MAX_MAPX, 0 To MAX_MAPY)
Next a
ReDim Map.Tile(0 To MAX_MAPX, 0 To MAX_MAPY)

    
    ' Check if the maps directory is there, if its not make it
    If LCase(Dir(App.Path & "\maps", vbDirectory))  "maps" Then
        Call MkDir(App.Path & "\maps")
    End If
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)