I've been working on different RPG techniques, startegies, etc. before I truly commit a significant amount of time towards a project. The method i've been using for maps and graphics is actually pretty cool, i think. Or at least I thought so when I first learned it. You write a couple lines of code that look like this:
DATA 00,01,01,01,00
DATA 00,01,01,01,00
DATA 00,00,00,00,00
DATA 00,01,01,01,00
DATA 00,01,01,01,00
[i/]
This would create a crude black H, 5x5 pixels in size, with a blue background. (Each of the numbers stand for a color. The sprite is then call using the following code:
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), sprite1
Then, let's pretend I had done three different types of sprites. We'll call them sprite1, sprite 2, and sprite 3. Another DATA thing is made after the three sprites ones, which would look like this:
DATA 1,1,1,1
DATA 1,2,2,2
DATA 1,3,3,3
Then, finally, somewhere in the code, the program takes the map, and converts the one's to sprite one, the two's to sprite two, etc. So in my example here, if all the sprites had been the same size as the first one. It would be a 4x3 map of 5x5 sprites. There is a little more to it, but it isn't really necessary. Anyway, I want to know if there is a way that I can store all those lines of DATA 00, etc. into a file. One file for each sprite/map, or else one file for all the sprites and maps. I waste 266 lines of code (and i would ideally like to create maybe ten times the number of sprites i have now.) So anyway, is there anyway to do this? -Mike
DATA 00,01,01,01,00
DATA 00,01,01,01,00
DATA 00,00,00,00,00
DATA 00,01,01,01,00
DATA 00,01,01,01,00
[i/]
This would create a crude black H, 5x5 pixels in size, with a blue background. (Each of the numbers stand for a color. The sprite is then call using the following code:
FOR y = 1 TO 13
FOR x = 1 TO 15
READ clr
PSET (x, y), clr
NEXT: NEXT
GET (1, 1)-(15, 13), sprite1
Then, let's pretend I had done three different types of sprites. We'll call them sprite1, sprite 2, and sprite 3. Another DATA thing is made after the three sprites ones, which would look like this:
DATA 1,1,1,1
DATA 1,2,2,2
DATA 1,3,3,3
Then, finally, somewhere in the code, the program takes the map, and converts the one's to sprite one, the two's to sprite two, etc. So in my example here, if all the sprites had been the same size as the first one. It would be a 4x3 map of 5x5 sprites. There is a little more to it, but it isn't really necessary. Anyway, I want to know if there is a way that I can store all those lines of DATA 00, etc. into a file. One file for each sprite/map, or else one file for all the sprites and maps. I waste 266 lines of code (and i would ideally like to create maybe ten times the number of sprites i have now.) So anyway, is there anyway to do this? -Mike