Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2, 3, ... 11, 12, 13  Next
» View previous topic :: View next topic  
Author Message
yugniht


Member


Joined: 29 May 2003
Posts: 167

Posted: 06 Jul 2003 01:29:16 pm    Post subject:

hart326 wrote:
Speaking of routines, does anybody know of any good game menus, other than the one by Arcane Wizard?  I am looking for something cool to go with my game.  The menu I am using has been done before, and I want my menu to be unique, or more appropriately stand out.

try this here

here's the code:

Code:
StoreGDB 1
AxesOff
FnOff
ClrDraw
0->Xmin
0->Ymax
94->Xmax
-62->Ymin
Text(29,39,"OBJECT 1
Text(35,39,"OBJECT 2
Text(41,39,"OBJECT 3
Text(47,39,"EXIT
31->X
4->B
Lbl 1
Line(35,-B,35,-(B+2),0
Pxl-Off(B+1,36
Line(35,-X,35,-(X+2
Pxl-On(X+1,36
0
Repeat Ans
getKey
Text(-1,0,90,"
End
Ans->T
X->B
X-6(T=25)+6(T=34->X
Ans+24(Ans=25)-24(Ans=55->X
If Tų21
Goto 1
If T=21
Goto E
Goto 1
Lbl E
If X=31
Text(0,0,"CHECK OUT UAN
If X=37
Text(7,0,"ON TICALC.ORG
If X=43
Text(14,0,"IT USES THIS STYLE MENU
If X=43
Text(21,0,"BUT BETTER!
If X=49
Goto X
Goto 1
Lbl X
ClrDraw
RecallGDB 1
DelVar GDB1Output(1,16,"


You can change certain variables to change certain things, like where the options and arrows show up, or how many options you have. I hope this was helpful
Back to top
yugniht


Member


Joined: 29 May 2003
Posts: 167

Posted: 06 Jul 2003 01:39:09 pm    Post subject:

here's a routine for a mouse:

(the program is downloadable here so you don't have to retype it)


Code:
StoreGDB 1
AxesOff
FnOff
0->Xmin
0->Ymax
-62->Ymin
94->Xmax
Input "INTERVAL?",C
ClrDraw
45->X
-31->Z
0->A
0->B
Lbl 1
Line(A,B,A+3,B-3,0
Line(A,B,A+2,B,0
Line(A,B,A,B-2,0
Line(X,Z,X+3,Z-3
Line(X,Z,X+2,Z
Line(X,Z,X,Z-2
0
Repeat Ans
getKey
Text(-1,0,90,"
End
Ans->G
X->A
Z->B
X+C(G=74 or G=94 or G=84)-C(G=82 or G=72 or G=92->X
Z+C(G=74 or G=72 or G=73)-C(G=92 or G=94 or G=93->Z
If Gų23 and Gų21 or Gų105
Goto 1
YOUR-PROGRAM-GOES-HERE
Goto EX

Lbl EX
ClrDraw
RecallGDB 1
DelVar GDB1Output(1,16,"


Variable C is the interval a which the mouse moves. And you use the number pad to move it rather than the arrows, so there's 8 possible directions. Also, (X,Z) is the coordinates of the mouse. I think that's it.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 07 Jul 2003 12:15:31 pm    Post subject:

i wonder y people put in the name GAME... every one does it... is it just cause they dont know a good name yet? and, i dont ever use the subroutine thing, cause if they run the prgm with the var equalling the subroutine number, then it goes to the subroutine, instead of the prgm!
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 16 Jul 2003 12:43:36 am    Post subject:

thats why u use outrageous #s like (pi)^(the e above the division symbol)^2
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 16 Jul 2003 12:44:46 am    Post subject:

i have a prgm that can draw a 8*8 sprite in 2 sec from a 16 char string
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 16 Jul 2003 07:43:21 am    Post subject:

Adm.Wiggin wrote:
i wonder y people put in the name GAME...  every one does it...  is it just cause they dont know a good name yet?  and, i dont ever use the subroutine thing, cause if they run the prgm with the var equalling the subroutine number, then it goes to the subroutine, instead of the prgm!

I never use the name GAME for my programs or games, I only use it on these forums as an examlpe and so everybody knows what the game code is and what isn't.

As for subroutines, if you set it up correctly you won't have that problem. You could use a list, n, or rediculous numbers like Android mentioned. Of course there's still a remote possibility that whatever you use somehow get's your program to run the subroutine even though it shouldn't.

PRGM:

If 666333999=iPart(n
Then
fPart(n->n
If n=1:Then
//subroutine 1 here
End
If n=2:Then
//subroutine 2 here
End
End
//main code start's here
ClrDraw
Text(1,1,"A PRGM"
666333999.1->n
prgmPRGM
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 16 Jul 2003 10:20:14 am    Post subject:

my point exactly. and Arcane Wizard is right, i use prgmGAME to represent that the code is the game code also
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 16 Jul 2003 12:32:37 pm    Post subject:

ahh, thank u for the clarification... i now understand y that could work, thank u!
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 16 Jul 2003 02:05:03 pm    Post subject:

anything to help a friend... Wink
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 26 Jul 2003 09:01:25 pm    Post subject:

What's the fastest getkey routine? I use the following one:
getkey->K
While not(K
getkey->K
End

Is that good? Or is there a better one? I do know about Ans, and use it sometimes, but most of the time I can't because it gets overwritten.
Back to top
yugniht


Member


Joined: 29 May 2003
Posts: 167

Posted: 26 Jul 2003 09:04:09 pm    Post subject:

I use:

0
Repeat Ans
getkey
End
Ans->whatever

but someone showed me this once (note: when I used it in a program, it didn't work for some reason):

Repeat getkey
End
Ans->whatever
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 26 Jul 2003 09:09:31 pm    Post subject:

i use this :
Code:
getKey->C
Repeat C
getKey->C
End
i just change C to whatever im using... it may not be the best, but it works great...
Back to top
gorchy


Newbie


Joined: 30 May 2003
Posts: 19

Posted: 27 Jul 2003 05:24:57 am    Post subject:

you don“t get an ans if you use:

Repeat Getkey
End

but it works if you make something like "press any key"
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 27 Jul 2003 06:59:48 am    Post subject:

In which case you might as well use pause, safe some bytes and it's even faster.
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 27 Jul 2003 10:55:31 am    Post subject:

the fastest and smallest is

Code:
Repeat Ans
getKey
End
If Ans=1
dothis
If Ans=2
dothis
etc.

hart326 had Ans->K at the end of his routine, which isnt nessecary
Back to top
yugniht


Member


Joined: 29 May 2003
Posts: 167

Posted: 27 Jul 2003 12:03:06 pm    Post subject:

I store it to K so I can use it after any other operation is done. That way, Ans will change, but not K.
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 27 Jul 2003 12:50:01 pm    Post subject:

right
my routine is better just for the fastest getKey routine, but ur is better overall. Neutral
Back to top
yugniht


Member


Joined: 29 May 2003
Posts: 167

Posted: 27 Jul 2003 02:18:55 pm    Post subject:

ok, technically that's right. But after looking at mine again, I could probably shorten it to:

Repeat K
getkey->K
End

It may not be the fastest, but it's shorter than my old one.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 27 Jul 2003 02:21:04 pm    Post subject:

And you arrive at what I've been using since I started with tibasic Laughing.
Back to top
Alan


Member


Joined: 12 Jul 2003
Posts: 145

Posted: 27 Jul 2003 03:39:21 pm    Post subject:

i use:

while getkey=0
getkey->K
end

it repeats until a key is pressed and then continues with the key pressed in K
Back to top
Display posts from previous:   
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
    » Goto page Previous  1, 2, 3, ... 11, 12, 13  Next
» View previous topic :: View next topic  
Page 2 of 13 » All times are GMT - 5 Hours

 

Advertisement