プレイ日記
κιъъιε kibbledude
anyone hav any txt adventure games???
4そうだね
プレイ済み
返信[1]
親投稿
Stewart segludian1
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.
1そうだね
プレイ済み
返信[2]
親投稿
κιъъιε kibbledude
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!
0そうだね
プレイ済み
返信[3]
親投稿
*J.P.*[P]£ aj2003aj
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.
0そうだね
プレイ済み
返信[4]
親投稿
PChicken NerdChicken
IF I$ == "P" THEN
0そうだね
プレイ済み
返信[5]
親投稿
Stewart segludian1
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$.
0そうだね
プレイ済み
返信[6]
親投稿
κιъъιε kibbledude
pchicken I do that exact thing (IF PUNCH$=="P" THEN) but it still doesn't work!
0そうだね
プレイ済み
返信[7]
親投稿
Stewart segludian1
A screenshot of your code might help find the problem. I am guessing something is wrong with how you are reading PUNCH$ from the keyboard.
1そうだね
プレイ済み
返信[8]
親投稿
Stewart segludian1
You may also be wanting something like IF LEFT$(PUNCH$, 1) =="P" THEN to only check the first character.
1そうだね
プレイ済み
返信[9]
親投稿
κιъъιε kibbledude
:}
0そうだね
プレイ済み
返信[10]
親投稿
Stewart segludian1
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.
0そうだね
プレイ済み
返信[11]
親投稿
Stewart segludian1
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.
0そうだね
プレイ済み
返信[12]
親投稿
κιъъιε kibbledude
so how do i make it where it tells u if u type something wrong?
0そうだね
プレイ済み
返信[13]
親投稿
PChicken NerdChicken
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.
0そうだね
プレイ済み
返信[14]
親投稿
Stewart segludian1
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.
1そうだね
プレイ済み
返信[15]
親投稿
κιъъιε kibbledude
Thanks guys!
1そうだね
プレイ済み