Yea, you have seen what i usually do (Choice 1-6) and im trying to step away from that for awhile. You know, learn something new.

Well heres the code... hope it helps.

First Battle:

Code:
:ClrHome
:AxesOff
:ZStandard
:ClrDraw
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:1000→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"BRIGGS:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:ClrHome
:If A≤0 and B≥0
:Then
:"BRIGGS WINS        GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:AxesOn
:End


Second Battle:

Code:
:ClrHome
:AxesOff
:ZStandard
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:A+500→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"TANK:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:If A≤0 and B≥0
:Then
:"TANK WINS          GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:AxesOn
:End
:Goto θθ
:Lbl H
:ClrHome
:AxesOff
:ZStandard
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:1000→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"SPIDER:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:If A≤0 and B≥0
:Then
:"SPIDER WINS        GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:End
Wow.... slowly losing interest to finish games since i got a PSP, but im far from quitting. I still have Choice Endurance and Choice Endurance 2 to go. Also David's Epic Journey.
adamac15 wrote:
Wow.... slowly losing interest to finish games since i got a PSP, but im far from quitting. I still have Choice Endurance and Choice Endurance 2 to go. Also David's Epic Journey.
Sorry to hear that you're losing interest; surely you have just as much fun making games as playing other people's games though, no? I know many of us here do. Good luck on those continuing projects.
KermMartian wrote:
adamac15 wrote:
Wow.... slowly losing interest to finish games since i got a PSP, but im far from quitting. I still have Choice Endurance and Choice Endurance 2 to go. Also David's Epic Journey.
Sorry to hear that you're losing interest; surely you have just as much fun making games as playing other people's games though, no? I know many of us here do. Good luck on those continuing projects.
Yes, i enjoy both very much. I still need help with David's Epic Journey, but not right now. I have to finish CE1 and 2.
Welp, keep up the good work, then; I trust you'll post with progress reports and with any questions you have.
Choice Endurance 1:Done
Choice Endurance 2: Still being worked on (3rd person)
Choice Endurance 2 will be available for TI-83+/84+ and TI-86
adamac15 wrote:
Well heres the code... hope it helps.


I cut down on the size of this file. I do not know if you can make this work for you or not; I have not put it on my calc, and I am sure that you may want to make some changes. It should allow you to put more enemies in the game without so much size. You can store to C in another program before you go there if you would like to instead of fighting continuously. I thought this might help a little. It is a lot smaller than what you planned to use. Hopefully you can figure this out. At the end I added a pause so you can read the output before it disappears with ClrDraw. The more enemies you add, the more you will see the size difference.

Code:

:Lbl A
:ClrHome 
:AxesOff 
:ZStandard 
:Text(25,35,"LOADING") 
:Shade({-}3,{-}1 
:ClrHome 
:ClrDraw
:0→C
:1000→B
Lbl A1
If C=1:500→A
If C=2:1000→A
If C=3:1000→A
Lbl A2
:randInt(1,3→D 
:getKey→Z 
:Text(1,1,Str2+":",A) 
:If C=1
:Text(16,1,"TANK:",B)
:If C=2
:Text(16,1,"SPIDER:",B)   
:If C=3
:Text(16,1,"TANK:",B)
:Text(32,1,"HIT WHERE?") 
:Text(40,1,"LOW=1 MID=2 HI=3")
If Z=92 or Z=93 or Z=94
:Goto A3
:Goto A2
:Lbl A3
:If Z=92 and D=1 
:Text(48,1,"BLOCKED") 
:If Z=92 and D=2 
:Then 
:randInt(1,20→E 
:A-E→A 
:If C=2
:Text(48,1,"SPIDER HITS") 
:If C=1
:Text(48,1,"BRIGGS HITS")
:If C=3
:Text(48,1,"TANK HITS") 
:End 
:If Z=92 and D=3 
:Then 
:randInt(1,20→E 
:B-E→B 
:Text(48,1,Str2+" HITS") 
:End 
:If Z=93 and D=1 
:Then 
:randInt(1,15→E 
:B-E→B 
:Text(48,1,Str2+" HITS") 
:End 
:If Z=93 and D=2 
:Text(48,1,"BLOCKED") 
:If Z=93 and D=3 
:Then 
:randInt(1,15→E 
:A-E→A 
::If C=2
:Text(48,1,"SPIDER HITS") 
:If C=1
:Text(48,1,"BRIGGS HITS")
:If C=3
:Text(48,1,"TANK HITS") 
:End 
:If Z=94 and D=1 
:Then 
:randInt(1,10→E 
:A-E→A 
:If C=2
:Text(48,1,"SPIDER HITS") 
:If C=1
:Text(48,1,"BRIGGS HITS")
:If C=3
:Text(48,1,"TANK HITS") 
:End 
:If Z=94 and D=2 
:Then 
:randInt(1,10→E 
:B-E→B 
:Text(48,1,Str2+" HITS") 
:End 
:If Z=94 and D=3 
:Text(48,1,"BLOCKED") 
:End 
:If A≤0 and B≥0 
:Then 
:If C=1
:"SPIDER WINS        GAME OVER 
:If C=2
:"BRIGGS WINS        GAME OVER 
:If C=3
:"TANK WINS          GAME OVER   
:C+1->C
:If C=4:prgmA
:ClrDraw 
:AxesOn:Goto A 
:End 
:If B≤0 and A≥0 
:Then 
:"YOU WIN   CONGRATS!   
:40->E
:While E>0
:E-1->E
:End
:ClrDraw 
:C+1->C
:If C=4:prgm A
:Goto A
:End
:Goto A2
You can also remove the parentheses at the ends of the lines.
adamac15, D is randomly either 1, 2, or 3. What each of these numbers does is, with respect to your code, dependent on Z. Yet, note that each of D's responsibilities has a 1/3 chance of occurring, no matter what Z happens to equal. In other words, Z does not have any bearing at all on what takes place in the fight. In optimizing, Z simply drops out of all expressions that have an impact on the game's outcome.

To provide more evidence, I made this table:


Code:
Z    D   Effect
92   1   1
92   2   2
92   3   3
93   1   3
93   2   1
93   3   2
94   1   2
94   2   3
94   3   1

         1="BLOCKED
         2="BRIGGS HITS
         3=Str2+" HITS


Given Z and D, the Effect equals:


Code:
round(3fPart(3‾¹(2Z+D-1


But D is just a random number at this point:


Code:
round(3fPart(3‾¹(2Z+randInt(1,3)-1


As it so happens, for each category Z, the three possible results hinge on this number. And each of the three categories has the same possible results, but in a different order, with its items to be selected by D. But because D is random, the categories all collapse into each other with identical behaviors, so it doesn't matter which one you choose. Thus, in short, Z is bunk.


Code:
:Repeat 2>abs(Ans-93
:getKey
:End
:randInt(1,3→D
:randInt(1,20
:ClrDraw
:If D=1
:Text(48,1,"BLOCKED
:If D=2
:Then
:A-Ans→A
:Text(48,1,"BRIGGS HITS
:End
:If D=3
:Then
:B-Ans→B
:Text(48,1,Str2+" HITS
:End


That covers the first battle. The other battles use Z in the exact same trivial manner and can be reduced in the same way. After that, very little needs to be added to make a single script work for a generalized opponent without duplicating any code. When you come to terms with what I have just shown you, I'll help you write that in.
Weregoose: and souvik1997:
You are both correct and none my programs have parenthesis at the end of each Text(. I hope all of this helps and does not confuse. You could also just make it simple and delete some more of the code by saying

Code:

:Lbl A
:ClrHome 
:AxesOff 
:ZStandard 
:Text(25,35,"LOADING 
:Shade({-}3,{-}1 
:ClrHome 
:ClrDraw
:0→C
:1000→B
Lbl A1
If C=1:500→A
If C=2:1000→A
If C=3:1000→A
Lbl A2
:randInt(1,3→D 
:getKey→Z 
:Text(1,1,Str2+":",A 
:If C=1
:Text(16,1,"TANK:",B
:If C=2
:Text(16,1,"SPIDER:",B   
:If C=3
:Text(16,1,"TANK:",B
:Text(32,1,"HIT WHERE?
:Text(40,1,"LOW=1 MID=2 HI=3
If Z=92 or Z=93 or Z=94
:Goto A3
:Goto A2
:Lbl A3
:If  D=1 
:Text(48,1,"BLOCKED 
:If  D=2
Then   
:randInt(1,10→E   
:B-E→B   
:Text(48,1,Str2+" HITS 
:End   
:If  D=3
:Then   
:randInt(1,10→E   
:A-E→A   
:If C=2 
:Text(48,1,"SPIDER HITS   
:If C=1 
:Text(48,1,"BRIGGS HITS
:If C=3 
:Text(48,1,"TANK HITS   
:End 
:If A≤0 and B≥0   
:Then   
:If C=1 
:"SPIDER WINS        GAME OVER   
:If C=2 
:"BRIGGS WINS        GAME OVER   
:If C=3 
:"TANK WINS          GAME OVER     
:C+1->C 
:If C=4:prgmA 
:ClrDraw   
:AxesOn:Goto A   
:End   
:If B≤0 and A≥0   
:Then   
:"YOU WIN   CONGRATS!     
:40->E 
:While E>0 
:E-1->E 
:End 
:ClrDraw   
:C+1->C 
:If C=4:prgm A 
:Goto A 
:End 
:Goto A2

Code:
:Text(48,1,sub("BRIGGSSPIDERTANK",6C-5,6-2(C=3))+" HITS
How would you translate this into TI-86? (if it isn't already)
adamac15 wrote:
How would you translate this into TI-86? (if it isn't already)
It would probably be pretty close, other than the differing screen widths. I'm sure you could figure out the command equivalents. Smile
well that project is over and done with. Ill include this into the next one (if there is a CE 3: already almost done with the TI-83+/84+ version of CE 2 (just gotta rename some people))
adamac15 wrote:
well that project is over and done with. Ill include this into the next one (if there is a CE 3: already almost done with the TI-83+/84+ version of CE 2 (just gotta rename some people))
Sounds great, keep up the good work.
adamac15 wrote:
well that project is over and done with. Ill include this into the next one (if there is a CE 3: already almost done with the TI-83+/84+ version of CE 2 (just gotta rename some people))

That does sound good. I hope you are just as sucessful with your next projects.
Thanks..... im going to go through with making CE 3 after i add some finishing touches to CE 2. I still have DEJ to the side, but that'll come later (probably after CE 3: Because i still have yet to learn how to make an RPG; then again, i never have tried to learn either, been busy with all the other projects ive been adding on.)

Progress of all current projects:
Choice Endurance 1 (Finished, making some changes (" 's and )'s))
Choice Endurance 2 (TI-83+/84+ version-Finished (same as CE 1)/TI-86 version- still being worked on)
Choice Endurance 3 ( Aside until TI-86 version of CE 2 is done)
David's Epic Journey (Aside until i learn how to make (possibly after CE 3))
New progress:
Choice Endurance 1 (Finished)
Choice Endurance 2 (Same as before)
Choice Endurance 3 (Same as before)
David's Epic Journey (Same as before)
Great job, keep up the good works! Did you ever re-upload the file you had accidentally uploaded as a .8xp instead of a .zip with a readme?
No. We don't get my computer back until tomorrow, hopefully virus free. When i do get it i will.

EDIT:YAY! The computers virus free. For now.

Anywho... Im thinking about putting the TI-86 version of CE 2 aside until i finish with the TI-83+/84+ version of CE 3. After that, ill get back to the TI-86 version of both CE 2 and CE 3.
  
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, 4, 5, 6, 7  Next
» View previous topic :: View next topic  
Page 6 of 7
» 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