Interesting.
I probably could answer a few of your questions, but I don't want to lecture.
I guess for maps with DATA, you have a BG table array.
DIM BGTABLE%[10]
You also have a map data array (string array). Like so:
DIM MAPL0$[15]
It has an element for each 16x16 horizontal strip, here is a diagram to demonstrate what I mean:
1:■■■■■■■■■■■■■■■■■■■■■■■■■
2:■■■■■■■■■■■■■■■■■■■■■■■■■
We will come back to this array when reading the map data.
You can set these values to what ever background tile number you want them to be; 0, 1, 5, 57, 294, 1016, or any other tile you want to use. Then with DATA you write your maps with whatever you represent them as. I would recomend doing this with character codes that increase by 1 each time. It could be
1234567890
or
ABCDEFGHIJ
or anything that works like that. One way you can make sure you are going in the right order is with CHR$(). Like
?CHR$(57)
?CHF$(58)
So you have your map data. It could be something like this:
DATA "0000000000000000000000000"
DATA "1000008000000000000000000"
DATA "3100076700000000000040000"
DATA "2100008000005000000000000"
DATA "1000000000000000000000000"
but it could also be anything else. Before you have your map data you can have BG table data, to set your BG table. Like this:
DATA 375
DATA 376
DATA 465
DATA
DATA "0000000000000000000000000"
DATA
So reading all of this is kinda interesting.
Before the data, you might want to put a lable, so you can easily do multiple maps:
@MAP0001
DATA
So anyway, in reading this, you put RESTORE "lable name":
RESTORE "@MAP0001"
It doesn't need to be a string, and people don't usually make it a string; with strings it's easier to comprehend receiving data from another slot:
RESTORE "1:@MAP0001"
Then you would read your bg table with something like this:
FOR I=0 TO LEN(BGTABLE)-1
READ BGTABLE[I]
NEXT
And then you would read your map data.
It would be something like this:
FOR I=0 TO LEN(MAPL0$)-1
READ MAPL0$[I]
NEXT
That's fairly simple. Displaying the map is a bit more complex.
To display it, you could do a lot of things. But this is the way I learned how to display the map, so use it and study it as you wish.
FOR I=0 TO LEN(MAPL0$)-1
FOR J=0 TO 24
IF ASC(MID$(MAPL0$,J,1))>=[the lowest character code] && ASC(MID$(MAPL0$,J,1))<=[the highest character code] THEN BGPUT I,J,BGTABLE[ASC(MID$(MAPL0$,J,1))-[lowest character code]]
NEXT
NEXT
I got kinda messy in displaying that code, but I'm sure it still at least slightly illistrates what I'm trying to say. Lots of string functions, lots of frustration :)
I love string functions