I am learning axe and am getting along nicely, but I don't know how to draw tilemaps. Could someone give me a small example of the code with explanations?
Thanks.
I can give it, but I can also point you to a much better tutorial on Omnimaga. If you're learning Axe, I really recommend to join Omnimaga, as this is the home of Axe. This is the best tutorial I know. If you dont want to join Omnimaga, you should say, and I'll post a tutorial here.
I moved this post to General Programming.
It should probably be merged into Axe Questions/Routines *Come here!*
It should. >.<
Apparently I have been rejected from omnimaga, when I tried to register. Sad
We also have a lot of Axe programmers here who can help you too. Wink Tilemapping is fairly straightforward. it's basically reading data and drawing sprites depending on the data read. I can also make some example code later, when I get the time. Smile
Here is a general Tilemap routine, with X = map address and Str1 holding tile data:


Code:
For(B,0,7
 For(A,0,11
  Pt-On(A*8,B*8,{B*12+A+Str1}*8+Str1
 End
End


Wink
Once again, let's try to keep Axe questions in Axe Questions/Routines for now.
KermMartian wrote:
Once again, let's try to keep Axe questions in Axe Questions/Routines for now.

I am too lazy to actually make my own post so instead I quote people and then don't say anything new.

Mind if I lock this thread so it gets moved for real Wink
Why not an AXE subforum?
We had that for a while, but no one posted :/ I think a single topic will suffice because we really haven't had many Axe questions. What do y'all think?
We had an Axe subforum, but it got deleted since it wasn't used that much.
How can I go about to make a appvar, and in the appvar there is a list?
Also a matrix?
Bump:
Can anyone give me a good place (link) to or can someone tell me about arrays in Axe, on how they work/use.
Thanks.
How about http://www.cemetech.net as the place? Razz

In Axe, arrays are really pointers to blocks of memory, and are made of bytes (or words, but later on that). When you use the array brackets (The curly ones, {}) you are getting the byte value for a certain memory location. For instance, you could make a simple list in L1 (Which is really just a pointer to a memory location, not a list like Basic uses). If you wanted to store values to L1 and then display them until it reaches a zero/null character, you would do it like:
Code:
42->{L1}
15->{L1+1}
19->{L1+3}
50->{L1+2}
0->A
While {L1+A}
Disp {L1+A}»Dec
A+1->A
End
When you refer to values, you typically use indirection, or having a main pointer and then adding more to it. For instance, referring to the 0th byte after L1 is really just {L1}, or talking about the 100th byte after L1 {L1+100}. When you are talking about values from a "list" ({L1+X}), you can use it just like you would a normal value. For instance
Code:
10->{L1+4}
Disp {L1+4}*{L1+4}+{L1+4}»Dec
(Which would return 110, because of Axe's order of operations). You can use values at L1 as another place to put variables as well. One thing you have to remember though, without the Radian symbol, it will only grab one byte, which can hold 0-255. If you use the radian symbol, it will grab two bytes (Like a normal variable), but you have to read them a little bit different. For instance:
Code:
15->{L1}{r}
400->{L1+2}{r}
1000->{L1+4}{r}
0->{L1+6}{r}
0->A
While {A*2+L1}{r}
Disp {A*2+L1}{r}»Dec
A+1->A
End
(A*2+L1 instead of L1+A*2 because of Order of Operations). You have to reserve two bytes for it, or else it will mess up. If you want to see how it will mess up, replace the A*2 parts with just A and recompile the code. Also, notable to point out, you can use any variable as a pointer. For instance, you could display the first 100 bytes of the OS using this:
Code:
0->A
While A<100
Disp {A}»Char
A+1->A
End
Hopefully this makes sense, if not just ask more questions Smile

Also, FWIW, I messed up quite a few times with using A=0 or A=A+1 instead of the TI Basic 0->A and A+1->A.
Nice link, lol, also thanks that adds to my suspicions of arrays.
  
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