Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Ti-newb on June 17, 2009, 03:15:57 pm

Title: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: Ti-newb on June 17, 2009, 03:15:57 pm
Okay, so i'm trying to make a platform game. and making a matrix to store the map in the program.. is very very large. And im pretty sure Strings would be easier. so here are my questions/options

First. make a string into a Matrice... HOW?

Second. the Celtic option.. *forgot exact name. but it uses a BINSTR instead of a Matrice*.. Can anyone tell me how that works?

Or.. any other suggestions?

*I might just make 1 BIGGG Map and have it scroll, or.. hit the end of the screen, and make myself appear in the other.. map.
Title: Re: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: simplethinker on June 17, 2009, 04:30:36 pm
Okay, so i'm trying to make a platform game. and making a matrix to store the map in the program.. is very very large. And im pretty sure Strings would be easier. so here are my questions/options

First. make a string into a Matrice... HOW?

Second. the Celtic option.. *forgot exact name. but it uses a BINSTR instead of a Matrice*.. Can anyone tell me how that works?

Or.. any other suggestions?

*I might just make 1 BIGGG Map and have it scroll, or.. hit the end of the screen, and make myself appear in the other.. map.
If this is for the contest, we can't help you with #1 (turn string into matrix).  We can, however, explain how Celtic III's tilemapper works.

"Binary string" isn't quite the best choice of words.  For a tilemapper, each sprite is represented by a number, which is the entry in the matrix for xLIB's tilemapper.  Celtic III's string tilemapper uses the elements of the given string as these numbers.  It allows you to use tiles numbered from 0-255.

If you were to use base-10 numbers in the string, you would need three digits for element.  By converting those numbers to hexadecimal you make it two digits for each element (thereby cutting 33% off the size).  Each number from 0-255 also designates a token on the calculators, so by using those tokens instead of hex digits you're again cutting one digit per element.  This string of tokens (or "binary string") requires one byte per element, whereas the "hex string" requires two bytes, and a decimal string would require three bytes.

Does that make any more sense?
Title: Re: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: Ti-newb on June 17, 2009, 04:32:03 pm
No, i have decided not to submit it.. well first. I changed it from a platform.. to more of a Illusiat style. And im not going to submit it anymore either.
Title: Re: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: Eeems on June 17, 2009, 06:38:15 pm
ah well in that case I will post some code that for you that will show you how to change a string to a matrix and a matrix to a string wait for the edit
EDIT: ok this takes a string of any length and converts it into a matrix, this allows for 37 different tiles
Code: [Select]
:{Y,X→dim([A]
:For(A,1,16)
:For(B,1,22)
:inString("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZθ",sub(Str1,XA+B-X,1
:Ans→S
:S→[A](A,B
:End:End
this one converts a matrix of any size and puts it into a string
Code: [Select]
:" →Str1
:For(A,1,Y)
:For(B,1,X)
:1+[A](A,B→S
:Str1+sub("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZθ",S,1→Str1
:End
:sub(Str1,2,length(Str1)-1→Str1
Title: Re: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: DJ Omnimaga on June 17, 2009, 11:29:35 pm
moved to Calc help and support
Title: Re: Xlib-CelticIII TILE MAPPINGGGG!!!
Post by: Ti-newb on June 18, 2009, 09:32:27 am
Hey Eeems. thanks for that converter. but i don't really understand it and Simple already explained to me HEX. and BIN. and then the use of STRINGTILE. so i'm going to use STRINGTILE..