I've started creating a game after being inspired by my little brother. After I get it in a playable condition I will post more about it, but today I need help with some fundamentals. I need to use a highly optimized menu system because my game is nearly all menu. Right now it's all in BASIC for my TI84+CE, and I'm okay with using hybrid basic.

So far I've been using a mess of Menu( and labels. The first menu has 7 options and 5 of those have 3 to 4 more options. (so far it's about 23 labels which I am really hating)
Does anyone know how to make a menu that can jump between several pages and isn't too enormous?
great!
Not sure about the enormous part, but my Kinematic program has a pretty fancy menu thing going on, If I remember correctly, there is only one piece of code for menus, but there are two different menus. This should be expandable to many menus, all on the same code (it would probably be pretty large, but its one of the smallest ways I can think of for making a bunch of custom menus)
Here is the code with a bit of annotation...


Code:
Lbl 3
1->Q          //just the initial position of the cursor, 1 is the first option, 2 is the 2nd and so on...
Repeat max(K={21,105,45          //leave the menu if either 2nd, Enter or Clear is pressed. Once you've left the menu, you simply need to redirect the user to the right place depending on the value of K and Q (if K = 45, leave the program) (if Q = 1, go to option 1), etc.
   "integralPhi        integralPhi
   real(6,0,34,16+8Q,15          //[re]drawing the cursor at the new position
   real(6,0,33,16+8Q,10
   Repeat K          //here, any value K is accepted (any keypress) but only up, down, clear, enter and 2nd will be checked for, and any other keypress will end up back here (the cursor will blink)
      getKey->K
   End
   "integralPhi        integralPhi          //just the cursor that I picked... could be an arrow or whatever...
   If max(K={25,34:Then
      real(6,0,34,16+8Q,30          //erasing the cursor
      real(6,0,33,16+8Q,30
   End
   Q+(K=34)-(K=25->Q          //incrementing and decrementing Q depending on which key was pressed, pretty standard...
   Q-A(Q=A+1)+Anot(Q->Q          //where the magic happens, figures out when to loop back from A. Since both menus here start at Q=1, it will loop back down when Q=0, and will loop back up when Q=A+1, which is one lower than the last element, which is too far
End

Basically, before reaching the code above, something like the code below needs to be done (initialising the variables A and B, and displaying the menu options)

Code:
"UARM/Oblique/Back          //The menu Options for menu 2
real(6,0,52,24,15,47
real(6,0,53,25,10,47          //displaying them (twice to get some fancy effect going on?)
3->A          //A is the amount of options
Goto 3          //go to the menu code...

Code:
"UARM/Oblique/Help/Quit          //The menu Options for menu 1
real(6,0,52,24,15,47
real(6,0,53,25,10,47          //displaying them (twice to get some fancy effect going on?)
4->A          //A is the amount of options


Hopefully this helps a little... I guess it's one of many ways you could go, when it comes to menus, I'm sure you could find very creative things Razz
Thank you! That is very helpful, I'm planning on making one of my own as some variables overlap with my program, but I may just steal a few ideas from this one Cool
--------------------------------------------------------------------------------------------------------
What is the real() command doing? I've never used it and the TI-Dev page doesn't really help much
--------------------------------------------------------------------------------------------------------
Oh shoot thats not with xLib is it? I have TextLib because I have a CE not a monochrome calc
Domino 464 wrote:
Thank you! That is very helpful, I'm planning on making one of my own as some variables overlap with my program, but I may just steal a few ideas from this one Cool
--------------------------------------------------------------------------------------------------------
What is the real() command doing? I've never used it and the TI-Dev page doesn't really help much
--------------------------------------------------------------------------------------------------------
Oh shoot thats not with xLib is it? I have TextLib because I have a CE not a monochrome calc

Yeah, the real( command just denotes an xLibC command (this was made for the ti-84 plus CSE) Since it is not native to the calc, I doubt there would be much on ti-basicdev Wink
In this code though, I only use the real(6,0,...) command which is the DrawString command (basically like output) It's meant to be used in half-res mode and all, but I guess you could still extract the main idea out of it and make it work in pure basic.. you'd need to change the coordinates, remove the arguments pertaining to color and updatelcd and make the options display one under the other (as you might have noticed, I use the / (divide) token as my newline char which is ascii code 47), but in pure basic, you would have to either display them one at a time, or use a lot of spaces since the output command does wrap around at the end of a line.
Basically, a lot would need to be changed, but the idea of using the same code to navigate menus and only needing to change the options is still very feasible without xLibC, in fact, my program should be in pure basic, but it was made in the days when I was just beginning to learn hybrid-basic and felt the need to use it everywhere Razz
  
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 GMT - 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