Hi, guys. I know some people had asked a lot about draw maps
WITH DATA. If you want to do that, well,
YOU are in the right place! Let's get started!
First, you'll need to put some arrays. Think like this.
DIM BGTABLE[5]
And we'll need the
MAP$ variable. Why? Here is shown.
DIM MAP$[6]
Then, the
AMAZING part is coming out.
FOR I=0 TO LEN(BGTABLE)
READ BGTABLE[I]
NEXT
For what use is this? It reads the tiles you have asignned to your map.
FOR I=0 TO LEN(MAP$)
READ MAP$[I]
NEXT
And this is for reading the complete map.
The complex part is coming out. Get ready!
Finally...
To render the map, we will use this code:
DEF MAPRENDER
FOR I#=0 TO LEN(MAP$)-1
FOR J#=0 TO LEN(MAP$[I#])-1
BGPUT 0,J#,I#,BGTABLE[(ASC(MID$(MAP$[I#],J#,1)))-48]
NEXT
NEXT
END
This is used to recompile the ASCII map and translate them to BG tiles.
And, as the (pre-)final step, we will write the custom functions after we made the scripts.
MAPREAD [number of the map to read]
MAPRENDER
Now, you will want to make your ASCII map, now, how the format is used?
@MAP_0X
DATA X
DATA "XXXXXXXXXXXXXXX"
I actually donโt know if you (the reader) understood what I wanted to mean on the example above.
Credit to rando!