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.

Program Announcements / Ye Olde Text Adventure

Author
Message
DarkSith
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 13th Nov 2002 14:17
Written a text adventure (not finished yet) no music yet but i think it works, mind you been writing it at school in Notepad, so not too sure whether it will work. Just copy the code below and paste it into DB. Should work an all versions.

rem *** Text Adventure ***

hide mouse
set text font "Times New Roman"
set text size 14

center text 300,100, "Welcome traveller to Arinsil. As you are new to this town you may wish to ask for directions. To the north is the Merchant District, here you can buy weapons, armour and accessories. To the East is the East Gate, this can take you to the Barrows of Kings which have a reputation for being haunted, take care if you decide to venture there! To the South is the Lords's Comfort, a reputable pub with good lodgings and tasty food. Finally to the West is the Sandy Dunes which hide a city withn a sandstorm, you will need to visit one of the inhabitants in Sand Street to access the city as they will teach you the melody needed to pass the storm.

wait 5000
cls

center text 300,100, "What do you want to do?"

center text 300,120, "Go North" : center text 300,140, "Go East" : center text 300,140, "Go South" : center text 300,140, "Go West"

input:

input "Enter Direction: ";direction$
if direction$=North then gosub north
if direction$=East then gosub east
if direction$=South then gosub south
if direction$=West then gosub west
suspend for key
cls

north:

center text 300,100, "You decide to go north and arrive at a weapons shop. You decide to enter."
wait 3000
cls

east:

center text 300,100, "You decide to go to the Barrows of Kings. You've heard rumours about this place and tighten your grip on your sword."
wait 3000
cls

south:

center text 300,100, "You head south and come to the pub that the gate guard told you about and decide to enter."
wait 3000
cls

West:

center text 300,100, "You wouldn't mind having a look at the Sandstorm city and head to Sand Street."
wait 3000
cls

center text 300,100, "You enter the weapon shop and a shopkeeper steps out from behind a curtain."
center text 300,140, "How can I help ya?"
wait 3000
cls

center text 300,100, "What do you want to do?"
center text 300,140, "Buy"
center text 300,160, "Steal"
center text 300,180, "Attack"
input "Enter choice: ";choice$

if choice$=Buy then gosub buy_wares
if choice$=Steal then gosub steal_item
if choice$=Attack then gosub attack_owner

buy_wares:

steal_item

center text 300,100, "The shopkeeper notices you try to steal something, he reaches behind the counter and grabs a large battleaxe! You must defend yourself!"
wait 3000
cls

center text 300,100, "";name$
center text 300,140, "Shopkeeper"
attack_owner


Try it out and let me know.
Guardian of Hell
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 14th Nov 2002 04:03
What was this coded in? I needed to make a whole bunch of changes in reg DB.
RPGgamer

Final Fantasy, best series ever made.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 14th Nov 2002 04:04
My bad school notepad- run it in DB and fix it!
RPGgamer

Final Fantasy, best series ever made.
DarkSith
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 14th Nov 2002 11:45
Oops! Over the weekend I'll fix it and place the new version here.... sorry

Guardian of Hell
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 18th Nov 2002 01:49
wooooah bugged like grandma
DarkSith
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 19th Nov 2002 16:37
Damn! Errr... OK, everyone. Stop copying this code and I will fix it. then it won't be full of bugs and wotnot.

The Day of Judgement will scorch mankind and will be condemned to Hell.
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 24th Nov 2002 01:48
You don't seem to be using arrays, which could cause really big problems when you try to expand it and/or include objects. I might write a tutorial on text games, I've had a bit of experience with them and know how to get them to work.
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 24th Nov 2002 02:57
arrays are god...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/2.5mbs Sat Con... I joined in!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 24th Nov 2002 03:57
create a 2d array data map and update the info with the position u are in the 2d array map.

a 1 allows u to traverse that way and a zero doesnt or something.

that snippet is a raw raw raw basic way of handling a text adventure game.

Login to post a reply

Server time is: 2024-11-21 11:14:04
Your offset time is: 2024-11-21 11:14:04