Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Creating a simplistic text based adventure

Author
Message
timax
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location:
Posted: 29th Jan 2005 01:08
I am going to try to make a text based adventure but I need some help with the codes first.

1. How can I place spaces in the text that appears on screen?
Example:
TEXT TEXT TEXT TEXT TEXT
TEXT TEXT TEXT
TEXT TEXT

is what I can do.


TEXT TEXT TEXT TEXT TEXT

TEXT TEXT TEXT

TEXT TEXT

Is what I am looking to do.

2. I am currently using the WAIT KEY command to let the reader pick their own pace. I would like to be able to use something like an If or statement for the text.
If reader presses key A, text A apears.
If reader presses Key B, text B apears.
How could I do this?

3. Any suggestions on how to make the whole thing look easier on the eyes?

Thank you all for your help
Foxy
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: The Dale, South Australia
Posted: 29th Jan 2005 11:26
1. With the:

TEXT TEXT TEXT TEXT

TEXT TEXT TEXT

TEXT TEXT

Thing all you need to do have this code after each line of printing code:



So instead of having:



Have:



That should make it print a space between the lines.

2. You need to use the inkey$() function in an if statement, such as below:



Between the quotes after the inkey$()= bit, just put the letter corresponding to the key you want to wait for. The code above merely says "If the user presses the "a" key, print the message "You pressed the a key" to the screen.

Hope I got you somewhere

If I were you and you were me, then you'd be yourself 'cos you are me and I am you.
timax
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location:
Posted: 30th Jan 2005 00:34
thank you for your help
timax
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location:
Posted: 30th Jan 2005 02:39
Ok the first commant works well but I am screwing something up on the 2nd one.


I know I have done something wrong with the coding because the program skips over the if statement. Any 1 know what I did wrong?
BaZko
19
Years of Service
User Offline
Joined: 24th Sep 2004
Location:
Posted: 30th Jan 2005 09:09
i added some stuff so it works:


Join the new years contest!
Foxy
19
Years of Service
User Offline
Joined: 4th Jan 2005
Location: The Dale, South Australia
Posted: 30th Jan 2005 09:59
Yeah, you need the do...loop bits in there or it will only check the if statement once, if the do...loop part is there it will keep checking the if statement until it sees that you've pressed the "a" key, when you do it will then exit the loop and goto the print1: label and continue on from there.

If I were you and you were me, then you'd be yourself 'cos you are me and I am you.
timax
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location:
Posted: 31st Jan 2005 00:45
thx bunches all
timax
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location:
Posted: 31st Jan 2005 10:48
Ok well I got it working up to a point.




What I am trying to do is (as you can see if you read the text) make a little sotry where you choose your own ending. Every one has helped a great deal and it is almost complete but the program go stuck near the end. It is hard to explain the problem but if you open the code as a program and you follow the story and follow the sequence: (1), (2). You will see that for some reason the 2nd option that you pick after you pick "going to the store" does not work. If any one needs this explained betetr I can try, but I don't realy know what to say. Thank you all

Login to post a reply

Server time is: 2024-09-23 10:18:40
Your offset time is: 2024-09-23 10:18:40