how exactly could i make a good map for an rpg that i am creating. i do not know if i want it to be on homescreen or graphscreen yet. and i read using strings but then i would not know how to scroll four ways.
Hmm I could help you with scrolling vertically but scrolling horizontally I have not found a good way and speed efficent way to do that yet but if you would want help on vertical scrolling just ask me
Using a Matrix would work, but it would be inefficient in terms of size...
actually, a string works very well for maps and that (and if you are using the Homescreen, then it takes nothing to display the map).
Just update the map section every keypress and change the top-left corner coordinates when you scroll. THis game uses that method, and the map renders quickly on an 84+ at least.
A string works perfectly, as long as you have an 8-element loop of 16-length substrings. There are a multitude of RPG engine packages on ticalc.org and elsewhere with such routines...
alright. I will search ticalc and download all the engines i can find to see how they work and maybe even try them.
How can you do horizontal scrolling though o.O?
the way i would do it would be to increase where i started the substring command at by a certain amount of spaces.
You might take a look at this:

http://www.ticalc.org/archives/files/fileinfo/364/36409.html

This should give you a good idea on basic String stuff, making maps with strings.

I plan on making a scrolling engine for the homescreen, if you want, I can make one up really quick. The best thing about my routines are they are stupid simple. Razz
That would only work for vertical. Horizontal you would have to use 8 substrings and keep jumping forward by.... wait.... I think you might need 16 substrings o.O I will work on a sample later today and try it out.

example

the first 8 substrings display the current part, the second 8 substrings display the next part (you could do this all with 1 string - complicated - or use 2 strings at a time, the place you want to scroll to and your current location.) you would have to do the opposite of this for scrolling to the left


Code:

16 -> b
for(a,1,16,-1

output(1,1,sub(str1,a,b
output(2,1,sub(str1,16 + a,b
... up to 8
if a > 1:then
output(1,a,sub(str2,1,a
output(2,a,sub(str2,17,a
... etc.
b-1 -> b
end


I am not 100% sure this will work (off the top of my head, but you can test it) Wink
No no no. Just have an MxN map, and given MxN, a string of MN characters, and a start X & Y, it's a piece of cake (assuming M>16, N>Cool:

For(A,1,8
Output(A,1,sub(Str0,M(Y-1)+X,16
End

You could also drop a getKey onto there, and you can even make it scroll with the character. I have an engine saved somewhere; I should publish it.
before i read kerms post here is what i came up with.

prgmA

Code:

:"XXXXXXXXXXXXXXXXX              XX              XX              XX              XX               X              XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX              XX              XX              XX              X               XX              XXXXXXXXXXXXXXXXX→Str1
:ClrHome
:1→R
:1→B
:For(A,1,8
:Output(A,1,sub(Str1,B,16
:B+16→B
:End
:2→C:2→D
:Repeat K=45
:getKey→K
:Output(C,D,"θ
:If max(K=24,25,26,34
:Then
:prgmB
:Output(C,D,"
:C+(K=34)(C<7)-(K=25)(C>2→C
:D+(K=26)(D<15)-(K=24)(D>2→D
:End
:End


prgmB

Code:

:If R=1 and C=6 and D=15 and K=26
:Then
:ClrHome
:For(A,1,8
:Output(A,1,sub(Str1,B,16
:B+16→B
:End
:2→R
:1→D
:End
:If R=2 and C=6 and D=2 and K=24
:Then
:ClrHome
:1→B
:For(A,1,8
:Output(A,1,sub(Str1,B,16
:B+16→B
:End
:1→R
:16→D
:End


now i just have to find a way to scroll vertical without it getting to confusing.
Keep in mind that your code will only work for a 16-wide map.
i came up with another way of checking the room you are in and the coordinates and i think it is faster which was a trade off for size because i use a matrix. here are the new programs. Also is there a more efficient and faster way to check room number and coordinates than this example and the one above as well?

prgm A

Code:

:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]→[A]
:"XXXXXXXXXXXXXXXXX              XX              XX              XX              XX              XX               XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX              XX              XX              XX              XX              X                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX              XX              XX              XX              XX              X               XXXXXXXXXXXXXXXXX→Str1
:ClrHome
:1→R
:1→B
:prgmC
:2→C:2→D
:Repeat K=45
:getKey→K
:Output(C,D,"θ
:If max(K=24,25,26,34
:Then
:prgmB
:Output(C,D,"
:C+(K=34)(C<7)-(K=25)(C>2→C
:D+(K=26)(D<15)-(K=24)(D>2→D
:End
:End


prgm B

Code:

:If R=1 and K=26 and [A](C,D)=2
:Then
:ClrHome
:1→[A](7,2
:2→R
:1→D
:prgmC
:End
:If R=2 and K=24 and [A](C,D)=1
:Then
:ClrHome
:0→[A](7,2
:1→R
:16→D
:1→B
:prgmC
:End
:If R=2 and K=26 and [A](C,D)=2
:Then
:ClrHome
:0→[A](7,15
:3→R
:257→B
:1→D
:prgmC
:End
:If R=3 and K=24 and [A](C,D)=1
:Then
:ClrHome
:2→[A](7,15
:2→R
:16→D
:129→B
:prgmC
:End


prgm C

Code:

:For(A,1,8
:Output(A,1,sub(Str1,B,16
:B+16→B
:End
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement