You could check the stickied pong thread at the top of this board.
Quote: "Please don't tell me make text games, a brain-dead
chimpanzee could make those..."
Why does everyone tend to say this? Text games can be just as difficult as most other games. Perhaps if you are just doing a "input your name" snippet, but an all out text adventure/rpg is not a simple task by any means. In fact, It requires the same logic principles and some sort of command parser on top to boot. The only thing that is missing is, a tile-system display engine, which IMO is not the hardest part of coding these type of games.
I wish I owned that brain-dead chimp!
case-in-point
(and this is just a simple 2 command parser, and the framework for a Very simple adventure)
Rem Project: Tower Of Mystery
Rem Created: 5/13/2005 9:49:14 PM
Rem ***** Main Source File *****
`============================================================================================
` I N I T I A L I Z A T I O N
`============================================================================================
Set display mode 1024, 768, 32
backdrop off
sync on
sync rate 60
ink RGB(128,255,128),0
`CONSTANTS
NUMROOMS=14
NUMTHINGS=11
NUMPOBJ=11
NUMVERBS=29
NUMOBJ=NUMTHINGS+NUMPOBJ
`Dimension Arrays
dim Access(NUMROOMS,6)
dim Verb$(NUMVERBS)
dim Object$(NUMOBJ+20)
dim RoomDesc$(NUMROOMS)
dim ItemDesc$(NUMTHINGS)
dim VerbToken(NUMVERBS)
dim ItemLoc(NUMOBJ)
dim ItemFlag(NUMTHINGS)
`Initialize Variables and flags
global cmd$
global cmd1$
global cmd2$
CurrRoom=1
CompStartTime=0
CoinFound=0
RatsTrouble=-1
CompAct=0
ManualFound=0
CompDoa=0
RdRFlag=-1
LoggedIn=0
BatsTrouble=-1
verbfound=0
`Initialize Arrays
`Roomdesc$ array
for i=1 to NUMROOMS
read RoomDesc$(i)
next i
`Verb$, VerbToken arrays
for i=1 to NUMVERBS
read Verb$(i),VerbToken(i)
next i
`Object$ array
for i=1 to NUMOBJ
read Object$(i)
next i
`ItemDesc$, ItemLoc, ItemFlag
for i=1 to NUMTHINGS
read ItemDesc$(i), ItemLoc(i), ItemFlag(i)
next i
`Access array
for i =1 to NUMROOMS
for j =1 to 6
read Access(i,j)
next j
next i
`============================================================================================
` M A I N G A M E L O O P
`============================================================================================
do
if RdRFlag=0
ink RGB(255,255,255),0
print
print "> ";
gosub Command_Input
ILoc=ItemLoc(ObjTkn)
select VerbTkn
case 1: print " ": gosub Directions: endcase
case 2: print " ": gosub Directions: endcase
case 3: print " ": gosub Directions: endcase
case 4: print " ": gosub Directions: endcase
case 5: print " ": gosub Directions: endcase
case 6: print " ": gosub Directions: endcase
case 7: print " ": gosub GO: endcase
case 8: print " ": gosub GO: endcase
case 9: print " ": gosub GO: endcase
case 10: print " ": gosub GO: endcase
case 11: print " ": gosub GO: endcase
case 12: print " ": gosub Go: endcase
endselect
else
RdRFlag=0
ink RGB(255,255,128),0
print RoomDesc$(CurrRoom)
k=0
for i=1 to NUMTHINGS
if ItemLoc(i)=CurrRoom
if k=0
k=1
print "You See:"
print ItemDesc$(i)
endif
endif
next i
print "Exits Are: "
for i=1 to 6
if Access(CurrRoom,i)<>0 then print verb$(i);" ";
next i
print
endif
`Test Stub
ink RGB(255,0,0),0
Print "Current Room"; CurrRoom
print
print "cmd$ "; cmd$
print
print "cmd1$ "; cmd1$
print
print "cmd2$ "; cmd2$
print
print "verbfound "; verbfound
print
print "VerbTkn "; VerbTkn
print
print "Verb$(c1) "; Verb$(c1)
print
print "ObjTkn "; ObjTkn
print
print "Object$(ObjTkn) "; Object$(ObjTkn)
print
if verbfound = 0
print "I don't know the verb "; cmd1$
endif
If VerbTkn<>11 and ILoc<>CurrRoom and ILoc<>0 then print "It isn't here!"
print " "
sync
loop
end
`============================================================================================
` E N D M A I N G A M E L O O P
`============================================================================================
`================== S U B R O U T I N E S =======================
Command_Input:
`***** Command INPUT/PARSER
`c2
`space
input cmd$: rem Get user input
str_length = len(cmd$):rem Find the length (str_length) of input
cmd1$="": rem Init cmd1$
cmd2$="": rem Init cmd2$
rem Initialize variables
c1=0
c2=0
v2=0
v1=0
space=0:
verbfound=0:
VerbTkn=0
ObjTkn=0
for i=1 to str_length: rem Look at each character (a$) in the users input
a$=mid$(cmd$,i): rem
a=asc(a$)
if a>=97 and a<=122
a$=chr$(a-32): rem Make everything upper-case
endif
if a$<>" ": rem If the character is not a space
if space=0: rem If we have not encounterd a space,
cmd1$=cmd1$+a$: rem Add the character to the first word.
else
cmd2$=cmd2$+a$: rem add the character to the second word
endif
endif
if a$=" "
space=1: rem We have encountered a Space
endif
next i
cmd1$=left$(cmd1$,5): rem Truncate cmd1$ to 5 characters
cmd2$=left$(cmd2$,5): rem Truncate cmd2$ to 5 characters
for v1=1 to NUMVERBS: rem Search the verb array for match with cmd1$
if Verb$(v1)=cmd1$: rem If we find a match
VerbTkn=VerbToken(v1): rem get the verbtoken and store it in VerbTkn
verbfound=1: rem A match was found
c1=v1: rem Save contentes of v1 to c1
v1=NUMVERBS: rem No need to search anymore Verb is Found!
endif
next v1
for v2=1 to NUMOBJ: rem Search the object array for match with cmd2$
if Object$(v2)=cmd2$: rem If we find a match
ObjTkn=v2: rem Store contents of v2 in ObjTkn
v2=NUMOBJ: rem No need to searvh anymore Object is Found!
endif
next v2
return
Directions:
If Access(CurrRoom,VerbTkn)=0 Then print "You can't go that way!"
If CurrRoom=4 and RatsTrouble<>0 and VerbTkn=3 then print "The rats look too fierce."
CurrRoom=Access(CurrRoom,VerbTkn)
RdRFlag=-1
sync
return
GO:
if ObjTkn=0 Then print "Pleas Give an Object"
`VerbTkn=ObjTkn-16
gosub Directions
return
`=============== D A T A S E C T I O N ===============
`Room/Area Descriptions
data "You are in the front of an old factory with a clock tower."
data "You are at the bottom of a stairwell."
data "You are at the top of the basement steps."
data "You are in a damp cellar."
data "You are in a storeroom."
data "You're in the cafeteria."
data "You're at a landing on the stairs."
data "Around you is a manufacturing area."
data "You're at a landing on the third floor."
data "You are in the computer room."
data "You are inside the clock tower."
data "You are at the top of the stairs."
data "You are in a long corridor going East."
data "You're at the East end of the corridor."
`Verb,Verbtoken data
data "N",1,"S",2,"E",3,"W",4,"U",5,"D",6,"GO",7,"EAT",8,"KICK",9,"INSER",10,"DEPOS",10,"TYPE",11
data "TAKE",12,"GET",12,"DROP",13,"THROW",13,"INVEN",14,"I",14,"MOUNT",15,"READ",16
data "FIGHT",17,"KILL",17,"START",18,"POWER",18,"OPEN",19,"QUIT",20,"LOOK",21
data "WIND",22,"EXAM",23
`Object data
data "RATS","TAPE","MACHI","TERMI","COIN","CANDY","COMPU","BATS","DESK","MANUA","CLOCK","ROAD"
data "DIR","ADVEN","COPY","LOGOU","NORTH","SOUTH","EAST","WEST","UP","DOWN"
`Item data
data "HUNGRY RATS",4,0,"COMPUTER TAPE",5,1,"VENDING MACHINE",6,0
data "BROKEN-DOWN TERMINAL",8,1,"COIN",-1,1,"CANDY BAR",-1,1,"Computer",10,0
data "BATS",13,0,"DESK",14,0,"COMPUTER MANUAL",-1,1,"ELABORATE CLOCKWORK",11,0
`Access data: Interconnections between rooms
data 2,0,0,0,0,0
data 3,1,0,0,7,0
data 0,2,0,0,0,4
data 0,0,5,0,3,0
data 0,0,0,4,0,0
data 0,0,7,0,0,0
data 0,0,8,6,9,2
data 0,0,0,7,0,0
data 0,0,10,0,12,7
data 0,0,0,9,0,0
data 0,12,0,0,0,0
data 11,0,13,0,0,9
data 0,0,14,12,0,0
data 0,0,0,13,0,0