So I'm trying to create a 48x48 TileMap engine for this Zelda fangame I'm working on. I would create a large string of data like "00,01,00,05,02,03,..." to indicate what kind of tile is being generated from the relative map coordinates that my player is in, from left to right. (e.g. I am in 1,1 and I move left one screen. Now I'm in 0,1)
I am trying to generate the rooms (up/down/left/right, or if possible all 8 screens within the room range) to my player's relative map coordinates, so the person playing won't see the levels being generated. Very similar to this:
<img src="http://morphcat.de/blog/img/0008-1.gif" border="0" />
.... except it generates only the rooms around the player.
I also wanted to delete the rooms that are too far away, so that the game runs at a constant speed.
I found out that I can manually edit the c2runtime.js so that it can load my AJAX links from the current directory "./" (by the way, is it possible to load a page named after a variable?). I can use that to load a CSV and store information as variables.
Each room is 9x8 tiles large (48x48 tiles), and I want to define a 2-digit number to indicate what each tile is.
Now here's the problem. I am not sure exactly how I would go about breaking each piece of the huge CSV string and store them into separate variables and continue to do so until I hit a specific amount of characters. I've tried storing the entire thing as a huge variable, but that didn't work as well as I'd hoped...
Does anyone here happen to know how to break up the huge CSV data string and store it into separate variables?