Skip to main content
Home Forums 68kMLA Chris68k's update log. — #10
Post #10 by chris
Source Forum68kMLA
CategoryTroubleshooting
Post DateMon, 21 Jul 2008 - 23:06
Original URLhttps://68kmla.org/bb/threads/chris68ks-update-log.14062/
Post
Well, as promised, here is the code for the game thus far. Note that there is no inventory system up yet (there's the beginning of one, but I removed it from this version so it's not clogging it up - doesn't work yet) and basically all you can do is walk around the 4 pretty rooms I inserted for testing. Regardless, it works.

Here it is, all 21 lines of it.

Code:
10 CLS:PRINT:PRINT "Simple Extensible Text Game by Chris - ? for help."
20 LET N=0:LET S=0: LET E=0:LET W=0:LET RD$="":LET A$="": LET R=0:LET SD=1 'clears all variables
30 GOSUB 3000 'goes to the rooms sub
40 LET A$=""
50 IF SD=1 THEN PRINT RD$ 'only shows room description if sd(show desc) is 1
60 INPUT "What now"; A$
70 IF A$="n" AND N=1 THEN LET R=R-2:LET SD=1:GOTO 30
80 IF A$="s" AND S=1 THEN LET R=R+2:LET SD=1:GOTO 30
90 IF A$="e" AND E=1 THEN LET R=R+1:LET SD=1:GOTO 30
100 IF A$="w" AND W=1 THEN LET R=R-1:LET SD=1:GOTO 30
110 IF A$="q" OR A$="quit" THEN END
120 IF A$="help" OR A$="?" THEN PRINT "This engine uses mainly 1-letter commands. Commands implemented thus far are n, s, e, w, q(uit), help or ?, l(ook), clear. All commands are lowercase. Thanks for playing.": LET SD=0:GOTO 30
130 IF A$="l" OR A$="look" THEN LET SD=1:GOTO 30
140 IF A$="vars" THEN PRINT A$: PRINT "room #:" R: PRINT "room desc:"; RD$: PRINT "n ";N:PRINT "s ";S:PRINT "e " E: PRINT "w ";W:LET SD=0: GOTO 30
150 IF A$="clear" THEN CLS: LET SD=0: GOTO 30
3000 IF R=0 THEN LET RD$="You are standing in a red sandstone room. The walls are striped orange and red, and spectacularly beautiful. There is a wide, natural arch to the east and a low crack in the stone to the south.": LET N=0:LET S=1: LET E=1:LET W=0
3001 IF R=1 THEN LET RD$="This room is made of shining metal, almost blindingly bright because of glowing orbs on the ceiling. There is a thick automatic door to the south and a threshold to red sandstone to the west.": LET N=0:LET S=1: LET E=0:LET W=1
3002 IF R=2 THEN LET RD$="This room is merely a tiny hole in the red sandstone of the cave. Water drips from the ceiling and runs off into a low passage to the east. There is also a crack in the rock to the north.": LET N=1: LET S=0: LET E=1: LET W=0
3003 IF R=3 THEN LET RD$="This is a giant natural cavern, with a mirror-flat pool of perfectly black water occupying most of the floor. There is a heavy automatic door to the north and a low passage to the west.": LET N=1: LET S=0: LET E=0: LET W=1
3050 GOTO 40
EDIT: Wow, looks really small here... The code looks a lot longer on the Olivetti screen. :lol:

mp.ls