Code:
Lbl 1
Menu("WHATS THIS?","DOOR",1,"DOOR",2,"DOOR",1,"DOOR",1)
Lbl 2
Menu("MORE DOORS?","DOOR",2,"DOOR",2,"DOOR",2,"DOOR",3)
Lbl 3
Menu("THIS IS BORING","DOOR",3,"DOOR",3,"DOOR",4,"DOOR",3)
Lbl 4
Menu("I CAN'T WAIT, KERM!","DOORS CE",5,"DOORS CE",4,"DOORS CE",4,"DOORS CE",4)
Lbl 5
Menu("I'M GOING TO SLEEP.","BOP IT",5,"TWIST IT",5,"PULL IT",6,"DOOR IT",5)
Lbl 6
Menu("...SILENCE...","ARE",6,"YOU",7,"BORED",6,"YET?",6)
Lbl 7
Menu("...","DOOR",7,"DOOR",7,"DOOR",7,"DOOR",8)
Lbl 8
Menu("YAWN","DOOR",9,"DOOR",8,"DOOR",8,"DOOR",8)
Lbl 9
Menu("BIGGER YAWN","DOOR",9,"DOOR",9,"DOOR",10,"DOOR",9)
Lbl 10
Menu("NARRATOR YAWNED HIMSELF OUT OF THE ROOM","GET",10,"RECT",11,"BRUH",10,"XD",10)
Lbl 11
Menu("WHATS THAT IN THE DISTANCE?","DOOR",12,"DOOR",11,"DOOR",11,"DOOR",11)
Lbl 12
Menu("IT'S NARRATOR!","DOOR",12,"DOOR",12,"DOOR",13,"DOOR",12)
Lbl 13
Menu("SUDDEN DEATH!","DOOR",15,"DOOR",15,"DOOR",15,"DOOR",14)
Lbl 14
ClrHome
Disp "YOU BEAT THE GAME!"
Disp "PRESS ENTER TO CONTINUE"
Pause
Stop
Lbl 15
ClrHome
Disp "YOU DIED..."
Disp "PRESS ENTER TO CONTINUE"
Pause
Goto 1


I just finished my new game and am looking for testers. Feel free to modify the code to make it better and please leave suggestions.

Cheers,
doofusthecow
For the simplicity of this game, it's actually pretty fun.
Here are a few tips for the future:
    ▪ For TI-BASIC programs like this, try to stick to single letter label names, thus making them compatible with everything from the TI-81 up
    ▪ Never, under any circumstances, use the Stop command, as this will completely prevent other programs from running yours. Instead, put a label at the end of your program and call that to end it, or just use Return
    ▪ If you don't know what a command does, hover over it in the menu and press [+] to get the syntax

Overall, nice work!
I look forward to seeing more of your programs.
calclover2514 wrote:
For the simplicity of this game, it's actually pretty fun.
Here are a few tips for the future:
    ▪ For TI-BASIC programs like this, try to stick to single letter label names, thus making them compatible with everything from the TI-81 up
    ▪ Never, under any circumstances, use the Stop command, as this will completely prevent other programs from running yours. Instead, put a label at the end of your program and call that to end it, or just use Return
    ▪ If you don't know what a command does, hover over it in the menu and press [+] to get the syntax

Overall, nice work!
I look forward to seeing more of your programs.


Thanks for the tips, I really appreciate it.
Disp has multiple arguments. And Pause has 0-2 arguments.
You can do this:

Code:

Disp "YOU BEAT THE GAME!
Pause "PRESS ENTER TO CONTINUE
Stop
Lbl 15
ClrHome
Disp "YOU DIED...","PRESS ENTER TO CONTINUE
ShinyGardevoir wrote:
Disp has multiple arguments. And Pause has 0-2 arguments.
You can do this:

Code:

Disp "YOU BEAT THE GAME!
Pause "PRESS ENTER TO CONTINUE
Stop
Lbl 15
ClrHome
Disp "YOU DIED...","PRESS ENTER TO CONTINUE

Thanks a lot. Like I said, I am fairly new to coding and am still trying to figure out how to do stuff. Suggestions for extra content are welcome.
Really cool first program! Glad you figured out where you wanted to start. Looking forward to future games! I also offer you a challenge: make the same program without using the menu command. It can be rewarding to make something over again but more complicated, as you can make it look more aesthetically pleasing like:
►Door 1◄
Door 2
Door 3

and when you press down on the calculator it goes to:
Door 1
►Door 2◄
Door 3

Overall, it is just a challenge to get your knowledge of the commands increased, so you don't have to do it. Nice work though!
Menu( is a byte-saver, and is faster, but the usage of labels kinda hinders the rest of the performance of the program, unless you can strategically place End statements within your labels without the Syntax Errors/Program Quit'g.
bdoggamer wrote:
Really cool first program! Glad you figured out where you wanted to start. Looking forward to future games! I also offer you a challenge: make the same program without using the menu command. It can be rewarding to make something over again but more complicated, as you can make it look more aesthetically pleasing like:
►Door 1◄
Door 2
Door 3

and when you press down on the calculator it goes to:
Door 1
►Door 2◄
Door 3

Overall, it is just a challenge to get your knowledge of the commands increased, so you don't have to do it. Nice work though!


I am confused about how to do this. The only way I can imagine that I could do that is to use getKey but I don't know how to do that. Please help.
doofusthecow wrote:
I am confused about how to do this. The only way I can imagine that I could do that is to use getKey but I don't know how to do that. Please help.

I recommend you take a look at this page for more info on that. TI|BD has a lot of routines and pages that I recommend reading through to enhance your TI-Basic knowledge Smile.
Here's an example (sorry if the animated png is too fast):



(I'll edit with code that's printed if you want.)
ShinyGardevoir wrote:
Here's an example (sorry if the animated png is too fast):



(I'll edit with code that's printed if you want.)


I'm at school, so I can't see the apng. I'll check it at home.
doofusthecow wrote:
bdoggamer wrote:
Really cool first program! Glad you figured out where you wanted to start. Looking forward to future games! I also offer you a challenge: make the same program without using the menu command. It can be rewarding to make something over again but more complicated, as you can make it look more aesthetically pleasing like:
►Door 1◄
Door 2
Door 3

and when you press down on the calculator it goes to:
Door 1
►Door 2◄
Door 3

Overall, it is just a challenge to get your knowledge of the commands increased, so you don't have to do it. Nice work though!


I am confused about how to do this. The only way I can imagine that I could do that is to use getKey but I don't know how to do that. Please help.



KEYCODES:
5:12
https://www.youtube.com/watch?v=KMMgo7NVDN8

Try this:

Code:

0→A:1→D
While 1
If D=1
Output(1,1,"..."
If D=2
Output(1,1,"..."
getkey→A
If A=34
D-1→D
If A=25
D+1→D
End

I'm tired so if this does not work...
I can offer a method for doing this that I use in my programs:

Code:
:0->A:0->B
Lbl A
ClrHome
If (B=~1)
2->B
If (B=3)
0->B
If (B=0)
Output(3,5,"[|>]Door 1[<|]
If (B=1)
Output(4,5,"[|>]Door 2[<|]
If (B=2)
Output(5,5,"[|>]Door 3[<|]
Output(3,6,"Door 1
Output(4,6,"Door 2
Output(5,6,"Door 3
Repeat A
getKey->A
End
If (A=25)
B-1->B
If (A=34)
B+1->B
If (A=21)
Then
If (B=0)
Goto B
If (B=1)
Goto C
If (B=2)
Goto D
End
Goto A


This method does leak memory, but only once when you select (pressing 2nd). There is probably a better way, but this is the way I do it because of how small it is and it leaks very little memory.
bdoggamer wrote:
I can offer a method for doing this that I use in my programs:

Code:
:0->A:0->B
Lbl A
ClrHome
If (B=~1)
2->B
If (B=3)
0->B
If (B=0)
Output(3,5,"[|>]Door 1[<|]
If (B=1)
Output(4,5,"[|>]Door 2[<|]
If (B=2)
Output(5,5,"[|>]Door 3[<|]
Output(3,6,"Door 1
Output(4,6,"Door 2
Output(5,6,"Door 3
Repeat A
getKey->A
End
If (A=25)
B-1->B
If (A=34)
B+1->B
If (A=21)
Then
If (B=0)
Goto B
If (B=1)
Goto C
If (B=2)
Goto D
End
Goto A


This method does leak memory, but only once when you select (pressing 2nd). There is probably a better way, but this is the way I do it because of how small it is and it leaks very little memory.


No! Leaking memory should be avoided. No amount of memory is small enough to be "acceptable", it's just bad practice. There are ways around this, just put the code you would have had at label "B", for instance, inside of your if statement.

There's no need for this- it's a confusing program flow and it leaks memory Smile
  
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