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.

TI-Basic => TI-BASIC
Author Message
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 28 Jul 2009 11:27:11 pm    Post subject: I have made a pong game that is free to anyone in return I ask for someone to help me make a full rpg game Code: ```PROGRAM:PONG :ClrHome :Output(4,1,"::::::PONG::::::" :Output(5,1,"BY: ADAM WHEELER :Output(8,3,"PRESS  ENTER :Pause :ClrHome :Lbl 1 :ClrHome :-2->I :7->A:8->B :DelVar C1->X :-1->Y:6->Z :While Not(C :ClrHome :Output(A,B,"O :Output(8,Z,"(---) :If A=1 :-X->X :If A=7 and B>=Z and B<=Z+5 :-X->X :If A=7:I+1->I :Output(1,1,I+1 :Output(1,14,U :If B=1 xor B=16 :-Y->Y :If A=8:Then :1->C :V-1->V :End :A+X->A :B+Y->B :Getkey :Z+(ans=26)-(ans=24) :If 13<=ans :1 :If 0>=ans :12 :ans->Z :End :ClrHome :Output(4,5,"YOU LOSE :Pause :ClrHome :If I>U:Then :I->U :Output(4,2,"NEW HIGH SCORE :Output(5,8,U :Goto 2 :Else :Goto 2 :Lbl 2 :Menu("PLAY AGAIN","YES",1,"NO",3 :Lbl 3 :ClrHome ``` CompleteLast edited by Guest on 30 Jul 2009 01:06:30 am; edited 1 time in total
Graphmastur

Joined: 25 Mar 2009
Posts: 360

 Posted: 29 Jul 2009 08:10:26 am    Post subject: Um.. We don't really do deal negotiations here. You can't "sell" your games. All TI games are free. We will help you make an rpg, sure. What do you need to know?
ztrumpet

Active Member

Joined: 06 May 2009
Posts: 555

 Posted: 29 Jul 2009 08:38:55 am    Post subject: We will all help, but there are not "trades" like this. Time to Optimize! (Don't type the stuff after // (It's a comment)) Code: ```PROGRAM:PONG :ClrHome :Output(4,1,"::::::PONG::::::BY: ADAM WHEELER // Output wraps around the screen if it's too long. :Output(8,3,"PRESS  ENTER :Pause  // The ClrHome that was here was "unused" because it hits another ClrHome after While not(C. :Lbl 1  // The ClrHome that was here was "unused" because it hits another ClrHome after While not(C. :-2->I :7->A:8->B :DelVar C1->X :-1->Y:6->Z :While Not(C :ClrHome :Output(A,B,"O :Output(8,Z,"(---) :If A=1 :-X->X :If A=7 and B>=Z and B<=Z+5 :-X->X :If A=7:I+1->I :Output(1,1,I+1 :Output(1,14,U :If B=1 xor B=16 :-Y->Y :If A=8:Then :1->C :V-1->V :End :A+X->A :B+Y->B :Getkey :Z+(ans=26)-(ans=24 //Leave off closing parenthesis to save a bite. :Ans-12(Ans=13)+12not(Ans->Z //Using logic to make this smaller and faster. :End``` It's not compleetly optimized, so if anyone else wants to, be my guest. Go to TIBD to learn more stuff; It's a great place for beginners. http://tibasicdev.wikidot.com/homeLast edited by Guest on 29 Jul 2009 08:39:28 am; edited 1 time in total
Weregoose
Authentic INTJ

Super Elite (Last Title)

Joined: 25 Nov 2004
Posts: 3976

kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 30 Jul 2009 01:14:29 am    Post subject: I finished typing the game and as far as optimization that was the original code its a lot better coded on my calculator I just havent wrote it down The rpg I was wanting to make is a graphical adventure game... I made one with three screens and it is to slow so i need help with a new one
ztrumpet

Active Member

Joined: 06 May 2009
Posts: 555

 Posted: 30 Jul 2009 11:56:15 am    Post subject: Graphics... Are you using pure basic, or xLib/Celtic III
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 30 Jul 2009 06:08:00 pm    Post subject: I am using pure basic to do this and I have figured out its better to use subroutines instead of Lbls because the if:goto statements are to slow... I want to make an adventure game with a map that is 10×10 at least and using subroutines this could be done
ztrumpet

Active Member

Joined: 06 May 2009
Posts: 555

 Posted: 30 Jul 2009 07:13:56 pm    Post subject: Cool! (I like pure basic...) You can kinda use subroutiens within a program. ex: Code: ```Goto A Lbl B subroutine End End more subroutiens here Lbl A While 1 If something Then Goto B End End``` Or you can do it the normal way (see next post). Last edited by Guest on 30 Jul 2009 09:15:15 pm; edited 1 time in total
IAmACalculator
In a state of quasi-hiatus

Know-It-All

Joined: 21 Oct 2005
Posts: 1571

 Posted: 30 Jul 2009 08:49:29 pm    Post subject: Or, alternately, you can actually write the routine in a separate program and then call it inside your main program using prgmSUBPRGM (or whatever you choose to name it).
AMkiller

Joined: 16 Dec 2008
Posts: 64

 Posted: 31 Jul 2009 09:57:36 am    Post subject: I recommend celtic III
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 31 Jul 2009 02:42:19 pm    Post subject: I dont know how to use or even get celtic III and i plan to use prgmSUBROUTN kind of thing
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 31 Jul 2009 03:14:20 pm    Post subject: Full pong game Code: ```PROGRAM:PONG :ClrHome :Output(4,1,"::::::PONG::::::BY: ADAM WHEELER :Pause :Lbl 1 :-1→I :0→k :7→A:8→B :1→X :-1→Y:6→Z :While (K=0 :ClrHome :Output(A,B,"O :Output(8,Z,"---" :If A=1 :-X→X :If A=7 and B≥Z and B≤Z+3 :-X→X :If A=7:I+1→I :Output(1,1,I :Output(1,14,U :If B=1 xor B=16 :-Y→Y :If A=8:Then :1→C :V-1→V :End :A+X→A :B+Y→B :Getkey :Z+(ans=26)-(ans=24 :Ans-14(Ans=15)+14not(Ans->Z :End :Output(4,5,"YOU LOSE :Pause :ClrHome :If I>U:Then :I→U :Output(4,2,"NEW HIGH SCORE :Output(5,8,U :Goto 2 :Else :Goto 2 :Lbl 2 :Menu("PLAY AGAIN","YES",1,"NO",3 :Lbl 3 :ClrHome``` The code is a little more optomized More basic pong game without scoring Code: ```PROGRAM:PONGSTP :7→A:8→B :DelVar C1→X :-1→Y:6→Z :While Not(C :ClrHome :Output(A,B,"O :Output(8,Z,"----- :If A=1 :-X→X :If A=7 and B≥Z and B≤Z+5 :-X→X :If B=1 xor B=16 :-Y→Y :If A=8:Then :1→C :V-1→V :End :A+X→A :B+Y→B :Getkey :Z+(ans=26)-(ans=24 :Ans-12(Ans=13)+12not(Ans->Z :End :Output(4,5,"YOU LOSE :Pause :ClrHome``` This is a faster version of my original pong gameLast edited by Guest on 03 Aug 2009 10:34:21 pm; edited 1 time in total
Weregoose
Authentic INTJ

Super Elite (Last Title)

Joined: 25 Nov 2004
Posts: 3976

 Posted: 31 Jul 2009 03:59:13 pm    Post subject: For the sake of lucidity and reduced VST (Vertical Scrolling Time), I must ask you to hold back from double-posting. Review the Terms and Conditions, and remember to use the button next time. (To practice, you could use this feature to merge your consecutive replies.) Are you picking apart your code line-by-line? Go with the simple premise that every line can be improved somehow, and don't stop looking until you've exhausted all the possibilities with each one. I'm eyeballing quite a few in there. An interesting thing about the Repeat command is that the condition is ignored until the loop is already given one pass. You could leave out the C variable and then consider by what premise exactly the loop will terminate, and accept that as the actual condition for the loop. Make sense?Last edited by Guest on 05 Jul 2010 08:18:27 am; edited 1 time in total
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 08 Oct 2009 08:51:47 am    Post subject: Im working on an update for this that will be much faster this is the main code though Code: ``` PROGRAM:PONG :ClrHome :Output(4,1,"::::::PONG::::::BY: ADAM WHEELER :Pause :Lbl 1 :-1→I:0→k :7→A:8→B :1→X:-1→Y :6→Z :While (K=0 :ClrHome :Output(A,B,"O :Output(8,Z,"---" :If A=1 :-X→X :If A=7 and B≥Z and B≤Z+3 :-X→X :If A=7:I+1→I :Output(1,1,I :Output(1,14,U :If B=1 xor B=16 :-Y→Y :V-1(A=8→V :End :A+X→A :B+Y→B :Getkey :Z+(ans=26)-(ans=24 :Ans-14(Ans=15)+14not(Ans->Z :End :Output(4,5,"YOU LOSE :Pause :If I>U:Then :I→U :Output(4,2,"NEW HIGH SCORE :Output(5,8,U :Goto 2 :Else :Goto 2 :Lbl 2 :Menu("PLAY AGAIN","YES",1,"NO",3 :Lbl 3 :ClrHome ```
MageKing17

Newbie

Joined: 17 Sep 2009
Posts: 3

 Posted: 08 Oct 2009 11:43:53 am    Post subject: So what's with the XOR obsession? How is it helping you, as opposed to your average OR?
dxfan101010

Member

Joined: 31 Mar 2008
Posts: 194

 Posted: 08 Oct 2009 05:04:34 pm    Post subject: Xor is only true if one or the other is ie: A=12. B=3 A=12 Xor b=3 false A=12 xor b=4. True
calcdude84se

Member

Joined: 09 Aug 2009
Posts: 207

 Posted: 08 Oct 2009 07:30:44 pm    Post subject: Yes, but I think he was saying that since B can never equal 1 and 16 at the same time, "or" does the same as "xor". Also, most of us tend towards "or" over "xor" when we have a choice. ([joke]Reason: It's one character shorter, so it saves a bit of screen space :biggrin:[/joke])
dxfan101010

Member

Joined: 31 Mar 2008
Posts: 194

 Posted: 08 Oct 2009 10:09:52 pm    Post subject: Srry. I did not actually get to look at the code my iPod won't let me
kinkoa

Member

Joined: 28 Jul 2009
Posts: 103

 Posted: 28 Oct 2009 10:34:26 am    Post subject: I know what or and xor do i made the primary game code a year ago when i first started programming and it seemed simpler at the time
Eeems

Joined: 25 Jan 2009
Posts: 277

 Posted: 28 Oct 2009 12:09:12 pm    Post subject: dxfan101010 wrote:Srry. I did not actually get to look at the code my iPod won't let meActually you can see it, you just have to copy the section into a note
 Display posts from previous: All Posts Oldest FirstNewest First
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.

»
 Page 1 of 1 » All times are UTC - 5 Hours