Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Munchor on November 06, 2010, 12:00:13 pm
-
Hey everyone, I have small knwoledge on axe and would like to know how to make a VERY SIMPLE title screen.
Can I use the same menus as in TI BASIC:
Menu("Choose","Play",1,"About",2,"Quit",3)
or
:ClrHome
:AxesOff
:ClrDraw
:1?W
:While W
:While W=1
:Text(1,1,"CHOOSE FORMULA
:Text(7,1,"1:CIRCLE AREA
:Text(14,1,"2:SPHERE VOL.
:Text(21,1,"3:CYLINDER VOL.
:Text(28,1,"4:CONE VOL.
:Text(35,1,"5:CONE SURFACE AREA
:Text(42,1,"6:QUADR. PYR. VOL.
:Text(49,1,"7:CYLINDER SURFACE AREA
:Text(56,1,"8:MORE FORMULAS
:Repeat 2>abs(5-abs(5-abs(Ans-83
:getKey
:End
:Ans?K
:If K=73
:Then
:ClrDraw
:2?W
:Else
:If K=92
:Then
:ClrHome
:Prompt R
:Output(4,2,"VOLUME IS:":Output(5,2,RRp
:End
:If K=93
:Then
(...)
Thanks
-
Menu() is the correct command if you want a simple title screen.
Make sure your labels match when you use it though.
-
Menu() is the correct command if you want a simple title screen.
Make sure your labels match when you use it though.
I think he wants to know how to do it in Axe. (Axe doesn't support Menu(), does it?)
-
Oh. It just said Title Screen. My fault.
If you want a menu in Axe, you'll have to hand make it and handle all input.
Axe doesn't handle anything on its own in regards to input or a native Menu() command.
-
:ClrHome
:AxesOff
:ClrDraw
:1?W
:While W
:While W=1
:Text(1,1,"CHOOSE FORMULA
:Text(7,1,"1:CIRCLE AREA
:Text(14,1,"2:SPHERE VOL.
:Text(21,1,"3:CYLINDER VOL.
:Text(28,1,"4:CONE VOL.
:Text(35,1,"5:CONE SURFACE AREA
:Text(42,1,"6:QUADR. PYR. VOL.
:Text(49,1,"7:CYLINDER SURFACE AREA
:Text(56,1,"8:MORE FORMULAS
:Repeat 2>abs(5-abs(5-abs(Ans-83
:getKey
:End
:Ans?K
:If K=73
:Then
:ClrDraw
:2?W
:Else
:If K=92
:Then
:ClrHome
:Prompt R
:Output(4,2,"VOLUME IS:":Output(5,2,RRp
:End
:If K=93
:Then
(...)
Something like that would work?
-
Something like that.
-
Something like that.
K, I'll try it.
BTW:
:.VIRUS
:ClrHome
:For(A,1,9999
:Pause 9999
:Pause 9999
:Pause 9999
:Pause 9999
Would this work as a successful virus in Axe?
I can't try it in my calculator, though
It doesn't work in the ROM: error: Block
-
this would be more effective
.Axe
While 1
End
Impossible for the user to break out of without pulling the battery. That, or
.Axe
Asm(C7)
Just shuts down the calc and resets ram, pretty much what you are going for
-
This code works while you add a new line with 'end', since youre use For.
Also, it isnt very fun, if you let execute this by someone who have important things in the RAM and doesnt know that he has just to wait.
-
Be sure to flip X and Y. For instance:
:Text(1,14,"2:SPHERE VOL.
instead of the original
:Text(14,1,"2:SPHERE VOL.
In Axe, it's Text(X,Y, "text here"), not weird TI's Text(Y,X, "text here"). :)
Also, Prompt will not work. It's not an implemented command yet. Input is there, but it has yet to be seen if it will work or not. (on 2.53MP) Syntax IIRC is:
input->Str0
...or whatever variable you wish to use :)
Then is not used at all with Ifs. You can simply remove them.
Finally, your keycodes are invalid - the one Axe uses is Xlib ones. The plus side though is that you can have multiple keys with: If getKey(1) and getKey(2)
Here's a really simple key ref program. Just compile and run! :)
.AXEKEYF Axe key finder
ClrHome
0->Z
0->Q
Text(0,0,"Axe Key Finder v1.0")
Text(0,0,"--------------------")
Text(0,57,"(C) Albert H. - Axe by Quigbo")
Text(0,12,"Key:")
While Q!=1 (this is the does not equal to sign, not a ! and a =)
getKey->Z
If Z!=0
Text(14,12," ")
Text(14,12,Z>Dec)
If Z=15
If Q=2
1->Q
End
If Q=0
Text(0,24,"Press CLEAR again to exit.")
2->Q
End
Else
Text(0,24," ")
0->Q
End
End
End
ClrHome
Have fun in Axe! :) It does take some guts to break some old BASIC habits, but once you're in, you'll have a LOT of fun! :D
-
About viruses, I would avoid using them maliciously except maybe if someone did lot of trouble to you or something :P, but even then it isn't a really good practice. :P
And yeah it took me a while to break some habits I had, especially using Output(0,0 instead of Output(1,1, not updating the screen every frame or locking myself inside endless loops X.x.
-
I can make a menu, my doubts is the GetKey, that's what I need to learn: getkeys, have no idea of how to use them :S
(http://img577.imageshack.us/img577/4858/keycodes.png)
I know these are the keys, but I can't make getkeys :S
-
ClrHome
Disp "Menu" ,i, "1) Start" ,i, "2) Options" ,i, "3) Help" ,i, "4) About" ,i, "5) Exit"
Repeat G=27
getkey->G
If G=34
sub(S)
End
If G=26
sub(O)
End
If G=18
sub(H)
End
If G= 35
sub(A)
End
End
ClrHome
What about reading the documentation and the commands list?
-
Thanks everyone, I'm getting some success:
ClrDraw
ClrHome
Text(0,0,"Title
Text(0,10,"1:Play
Text(0,20,"2:About
Text(0,30,"3:Help
Text(0,40,"4:Quit
getkey->Z
If G=34
// CODE FOR GAME
End
If G=26
ClrHome
Disp "GAME BY DAVID"
End
If G=18
Disp "HELP ..."
End
If G=35
Stop
What do you think
-
To use Getkey, for example,
Repeat getkey(15)
End
would cause a loop until you press key #15, which happens to be CLEAR. Getkey=15 also works, but it is not as responsive, although it is more like the TI-OS getkey, so it's easier to navigate menus.
-
To use Getkey, for example,
Repeat getkey(15)
End
would cause a loop until you press key #15, which happens to be CLEAR. Getkey=15 also works, but it is not as responsive, although it is more like the TI-OS getkey, so it's easier to navigate menus.
Great help thanks!
I have a BLOCK Error now, what kind of errors could be block erros...
Since 90% is compiled before the error, that means the error is in the end?
-
Probably there are too much Ends in the code.
The number of Ifs/Repeats and the number of Ends should be the same.
-
Probably there are too much Ends in the code.
The number of Ifs/Repeats and the number of Ends should be the same.
Thanks, I'll check that, the Axe Compiler should really tell us the line :S
EDIT: THAT WORKED! Now, I have a Titlte Screen, but it disappears right after, I don't want Pauses to make it stay there. Alternatives?
-
Yeah I wish it did. Hopefully in the final version he will.
-
@Scoutdavid
Did you tried to press PRGM while Axe output the error?
-
@Scoutdavid
Did you tried to press PRGM while Axe output the error?
No, I didn't. What would that do?
Now, I have a Titlte Screen, but it disappears right after, I don't want Pauses to make it stay there. Alternatives?
-
it scrolls to the error
Edit: make sure you have... in your code.. in that order
.....
Dispgraph
Cleardraw.
.......
-
that will make you go to the error that is specified
-
that will make you go to the error that is specified
Great, no idea lol, thansk much, now it'll all be easier
Now, I have a Titlte Screen, but it disappears right after, I don't want Pauses to make it stay there. Alternatives?
-
:repeat getKey
:end
does the same thing as pause in basic
I mean, it waits for a key
if you want enter to be pressed, do this:
:repeat getKey(9)
:end
-
My code:
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:getKey->Z
:If Z = 26
:Disp "BY DAVID
End
:If Z=18
:Disp "Help"
:End
:If Z=35
:Disp "Quit Program Code
:End
:If Z=34
// CODE FOR THE GAME
:End
how to make the title screen show up and I can choose keys from 1 to 4 and then do what the code here tells to do, I'm having some difficulties with the easiest part I guess :S
-
You should put the key test in a loop, as it was said here already two times.
-
it scrolls to the error
Edit: make sure you have... in your code.. in that order
.....
Dispgraph
Cleardraw.
.......
Oh wait I forgot Axe still had error scrolling. I thought it was removed because it caused crashes and stuff in earlier versions of Axe, especially with archived files.
-
You should put the key test in a loop, as it was said here already two times.
I tried Repeat getKey->Z
and it didn't work :S
-
as it was said here already two times.
I don't see where it was said ???
-
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:Repeat getKey->Z
:If Z = 26
:Disp "BY DAVID
End
:If Z=18
:Disp "Help"
sub(PAU)
:End
:If Z=35
:Disp "Quit Program Code
sub(PAU)
:End
:If Z=34
// CODE FOR THE GAME
sub(PAU)
:End
Lbl PAU
Repeat getkey->A
End
Return
-
:.(GAMENAME)
:Lbl 1
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:Repeat getKey->Z
:End
:If Z = 26
:ClrHome
:Disp "BY DAVID
:Repeat getKey
:End
:Goto 1
:End
:If Z=18
:ClrHome
:Disp "Help"
:Repeat getKey
:End
:Goto 1
:End
:If Z=35
:ClrHome
:Disp "Quit Program Code
:Repeat getKey
:End
:Goto 1
:End
:If Z=34
// CODE FOR THE GAME
:End
BTW, you'd better use Output( instead of Disp.
If you use Disp multiple times in one part of code, like
...
:Disp "1"
:Disp "2"
then all text will be displayed in one line so you get " 1 2"
But, thats all yours. with this code, it would work
EDIT: ninja'd
:D
Aichi, your use of a sub is very good, but you dont have to use
0->A
Repeat getKey->A
End
just use
Repeat getKey
End
-
as it was said here already two times.
I don't see where it was said ???
There are some mentions on page 1, for example from you.
Also, sorry if this part of my post was impolite. <.<
Edit @ aeTIos:
Hm, I think it has to be Repeat->Variable, else the previous keypress would not be ignored.
Edit²:
I mean Repeat getkey->Variable of course. :D
-
BTW, how do I make the sub? Using Alpha Low.Case?
-
you create a sub by [2nd][0][T][up][up][enter]
the 3 letters is the label you want to be "subbed" ;)
in games, you can use a sub when you use a specific routine very much
-
[2ND] [ 0] [T] [Up] [Up] - Token
Edit @ aeTIos:
If someone go to the help menu for example, by pressing 1. Repeat getkey (This one in the help menu) will be true via the key 1, which is still pressed.
-
:.(GAMENAME)
:Lbl 1
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:Repeat getKey->Z
:End
:If Z = 26
:ClrHome
:Disp "BY DAVID
:Repeat getKey
:End
:Goto 1
:End
:If Z=18
:ClrHome
:Disp "Help"
:Repeat getKey
:End
:Goto 1
:End
:If Z=35
:ClrHome
:Disp "Quit Program Code
:Repeat getKey
:End
:Goto 1
:End
:If Z=34
// CODE FOR THE GAME
:End
Gives me no errors, but the menu opens white and then when I press any key, the screen appears for a mili second and disappears again :(
-
:.(GAMENAME)
:Lbl 1
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:Repeat getKey->Z
:End
:If Z = 26
:ClrHome
:Disp "BY DAVID
:Repeat getKey
:End
:Goto 1
:End
:If Z=18
:ClrHome
:Disp "Help"
:Repeat getKey
:End
:Goto 1
:End
:If Z=35
:ClrHome
:Disp "Quit Program Code
:Repeat getKey
:End
:Goto 1
:End
:If Z=34
// CODE FOR THE GAME
:End
Gives me no errors, but the menu opens white and then when I press any key, the screen appears for a mili second and disappears again :(
D:
Put the End (this one after the Repeat start) into the last line.
Edit: After the repeat getkey->z
-
:.(GAMENAME)
:Lbl 1
:ClrHome
:ClrDraw
:Text(0,0,"TITLE
:Text(10,0,"1:Play
:Text(20,0,"2:About
:Text(30,0,"3:Help
:Text(40,0,"4:Quit
:Repeat getKey->Z
:End
:If Z = 26
:ClrHome
:Disp "BY DAVID
:Repeat getKey
:End
:Goto 1
:End
:If Z=18
:ClrHome
:Disp "Help"
:Repeat getKey
:End
:Goto 1
:End
:If Z=35
:ClrHome
:Disp "Quit Program Code
:Repeat getKey
:End
:Goto 1
:End
:If Z=34
// CODE FOR THE GAME
:End
Gives me no errors, but the menu opens white and then when I press any key, the screen appears for a mili second and disappears again :(
D:
Put the End (this one after the Repeat start) into the last line.
Edit: After the repeat getkey->z
There is an end after the getKey->Z and I did put it, though :S
-
Hmmm thats strange, is this your full code or do you have more that is part of a larger program?
-
Hmmm thats strange, is this your full code or do you have more that is part of a larger program?
Yes, I have, I'll start a new thread about it with the whole code
-
You have a Fix 5 somewhere in there don't you?
-
as it was said here already two times.
I don't see where it was said ???
There are some mentions on page 1, for example from you.
Also, sorry if this part of my post was impolite. <.<
Edit @ aeTIos:
Hm, I think it has to be Repeat->Variable, else the previous keypress would not be ignored.
Edit²:
I mean Repeat getkey->Variable of course. :D
Ah ok because the two posts in question seemed to talk about Repeat but for a different matter. X.x
-
You have a Fix 5 somewhere in there don't you?
Yes I do, I found a way to fix it.
Omg, are you a witch or something?
-
Haha nope but i saw that the only way that you could possible not be seeing something with that code is if those text commands were drawing to the buffer instead of the screen, and the only way that can happen if if you had a Fix 5 somewhere in the code :)
Its not witchcraft is merely the power of deduction! ;D Glad you got it to work too :)