Thank you for this base, the_squat1115!
Maybe I'll be able to revise this so you could have massive maps beyond the 128x127 restriction. I'd need this for my jump'n'run game so I can make massive levels.
โโโโโโโโโโโโโโโโโโโโโโโโ
There is a mistake I saw however but I don't blame you as I do this mistake over and over again lol.
This would result in Subscript out of range errors because these FOR instructions count beyond the length of the arrays. You need to append -1 to the LEN functions so no crashes will occur.
EDIT: My sentence structure goes wring sometimes...
DIM BGTABLE[5]'Depending on the number of tiles you want, you will need to put the exact number as the number of tiles you have, but you will need to jump 1 number, otherwise will cause a type mismatch.And we'll need the MAP$ variable. Why? Here is shown.
DIM MAP$[6]'You will want to put this, because it stores the number of DATA arrays you want.Then, the AMAZING part is coming out.
FOR I=0 TO LEN(BGTABLE) READ BGTABLE[I] NEXTFor what use is this? It reads the tiles you have asignned to your map.
FOR I=0 TO LEN(MAP$) READ MAP$[I] NEXTAnd 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 ENDThis 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] MAPRENDERNow, you will want to make your ASCII map, now, how the format is used?
@MAP_0X'Label of the map to read and translate. NOTE: the โXโ shown is a number of the map to use. DATA X'The โXโ is for the BG definition number to use. EXAMPLE: DATA 9'1 DATA "XXXXXXXXXXXXXXX"'Same as the DATA number to use. Read example above.I actually donโt know if you (the reader) understood what I wanted to mean on the example above. Credit to rando!