If you go to atariarchives the book creating adventure games on your computer has a some text adventure games. I got werewolf and wanderer working. usborne books has some 80s type in adventure games you could try converting too. I am currently working on the mystery of silver mountain. Write your own adventure programs for your microcomputer looks promising too. Good luck.
thanks but i asked because in my (not announced) txt adventire game, it works even when i type in anything. 4 instance, when i want them to type p for punch, it works if i type any letter either way!
plz help!
i think thats because of something to do with having it skip to the only or first command, like in my games menu when choosing the tutorial or not it goes to the game if you do something not input as a command or just enter.
You could do something like: INPUT "WHAT WILL YOU DO" ; R$ : IF R$ =="P" OR R$ == "PUNCH" THEN ...
If you just want to pull in keystrokes without waiting on INPUT try looking at INKEY$.
Reading input looks good, but I am worried about input validation. If I were to type "SMASH ALL THE POTS" for the first section, it doesn't tell me that I typed something wrong, and keeps running through to @2. With everything structured with GOTO, I am afraid you may end up with more of a choose your own adventure book than text adventure.
I am recommending you read the old 80s book"Write your own Adventure Programs for your Microcomputer" on the usborne website, it is a free (but hard to find) download and it is really short. The code won't run without changes on SmileBasic, but you only really need to look at how they structured the code. Map in an array, how the input is processed, that sort of thing.
Okay, so you should put your INPUT in a loop.
WHILE
INPUT "",T$
IF T$="blah" THEN GOTO @BLAH
IF T$="blah" THEN GOTO @BLAH
WEND
This way, if it doesn't go to a label, it will just ask for the input again.
I couldn't resist making a more generic function to check your input. I didn't want you to type nearly identical code dozens of times. This way you can pass it in a string of available options and get a true/false back. Keep looping if it returns false. Still more could be done like case conversion and trimming excess spaces but it works.