Calculator Community > Axe
Tilemapping help
ClainBill:
Because I'm organised 8) , I would like to NOT include my tile map code in the same program the rest of my code is in, Instead I can just put the map in another program (let's call it MAPCODE for fun) and in my main program refer the contents of this code and store it into GDB1
Let's say that:
--- Code: ---[01010101010101010101010101010101010101010101010101010101]->GDB1
[01000000000000000000000000000000000000000000000000000001]
[01000002030400000000000000000000000000000000000000000001]
[01000005060700000000000000000000000000000000000000000001]
[01000008090A00000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01010101010101010101010101010101010101010101010101010101]
--- End code ---
Is the contents in MAPCODE.
How?
How do I put this info into another program? so that now i don't have to scroll past this huge mass of code every time I'm going to change one small detail?
edit: This is in Axe in case anyone wasn't sure
Yeong:
There is this.
--- Code: ---prgmNAME | The code from the external program is parsed as if it completely replaced this command in the main program. (Similar to the C++ "include")
--- End code ---
Personally I like putting data like sprites and tilemaps to appvar.
ClainBill:
So I could just put
--- Code: ---prgmMAPCODE
--- End code ---
and because in that program I already said in the first row [...]->GDB1 that's now all I need?
I tried it and it throws an error : BAD HEADER ?
ClainBill:
figured it out, for future reference
Main Program (called MAINSRC)
--- Code: ---.MAIN
prgmMAPCODE
--- End code ---
Sub program (called MAPCODE)
--- Code: ---..MAPDATA
[01010101010101010101010101010101010101010101010101010101]->GDB1
[01000000000000000000000000000000000000000000000000000001]
[01000002030400000000000000000000000000000000000000000001]
[01000005060700000000000000000000000000000000000000000001]
[01000008090A00000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[010000000B0000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01000000000000000000000000000000000000000000000000000001]
[01010101010101010101010101010101010101010101010101010101]
--- End code ---
The sub program has to have a double dot .. and then a name so that axe knows its a sub program, then use prgmMAPDCODE (in this case) as usual
Xeda112358:
Thanks for posting the answer for future reference!
Navigation
[0] Message Index
[#] Next page
Go to full version