Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
100%
(1)
100% found this document useful (1 vote)
415 views
49 pages
Write Your Own Adventure Programs PDF
computer
Uploaded by
Gabriela Zilli
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save write-your-own-adventure-programs.pdf For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
100%
(1)
100% found this document useful (1 vote)
415 views
49 pages
Write Your Own Adventure Programs PDF
computer
Uploaded by
Gabriela Zilli
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save write-your-own-adventure-programs.pdf For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 49
Search
Fullscreen
ADVENTURE — WRITE YOUR OWN—4 OR YOUR MICROCOMPUTER :Ne aD E DVENTURE PROGRAMS . oy Jenny Tyler and Les Howarth en ss Designed by Roger Priddy Illustrated by Penny Simon, Rob McCaig and Mark Longworth ZX81 version of Haunted House by Chris OxladeoN = tS \ > 3 About this book 4 Whatis anadventure game? 6 Where to start 8 Drawingagrid 10 Hiding the treasures 12 Usefulobjects... 13 ...and what can be done withthem 14 Themaster plan 16 Putting the data into the computer 19 Theprogram structure 20 Getting into the program 28 Changing and adding tothe program 32 Debugging your adventure 33 Haunted House program listing 38 Changes for the Spectrum 39 Haunted House: ZX81 version 46 Extratips and hints 47 Answersto puzzles Index W SPECIAL NOTE Towrite an adventure program, youneed 4Y to know a bit about the language BASIC. You can still have fun with this book, though, without knowing any BASIC, by typing in and playing the game Haunted House which was written specially for it. If 4} you want to learn or improve your BASIC, there are two Usborne books to help you: Introduction to Computer Programming and Better BASIC.About this book Writing an adventure game from scratch is quite a daunting task, especially if youare new to computer programming, This book allows youto start as gently as youlike by giving you an adventure listing which you cantype inand play, change andaddtoas muchas youlike, oruse as askeleton program for your very own adventure story. The game written for this book is called Haunted House and you will find the main listing for it on pages 33-38. This will work onany computer which uses Microsoft- style BASIC, including BBC, Dragon, Oric, ‘TRS-80 and expanded VIC 20, and has changes to make it work ona 48K Spectrum (Timex 2000). A special ZX81 (Timex 1000) version of the game is listed on pages 39-45. Tumstraight to these pages if you wantto play the game before you find out howit works. It isa specially good idea todo thisif you've never played an adventure game. Ifyou are used to looking at program listings, you will probably pick up afew clues about how the game works as you type itin. To avoid this, you could try to persuade someone else totype it in for you. Asthe programis solongand complicated, you will need to type itin extremely carefully. Itis worth typing slowly and checking each line as you go, as you only need do it once. You can save the rogram on tape for when you want to play it again or produce an adapted version. On pages 6-15, you will find out howto planan adventure and on pages 16-27 how to structure and write the program fort. You may find this section quite difficult. Don't worry if you do, just work through each bit slowly and carefully until you feel you have grasped the ideas init, then goon tothe next bit. As you work through these pages itisa good idea to write a practice game of your own, following each step carefully. Don't worty ifit isn't a specially good game; it will help you to understand how the program works and see the problems you need to solve in order to write an adventure. A good. adventure needs careful planning tomake itinteresting and exciting to play. Remember, you don’t need to touch your computer until you have planned your game down tothe last detail. You will find some extra tips and hints on adventure writing on page 46, and onpage 47 there are answers to the puzzles set inthe book. After playing Haunted House afew times, you will probably want tomake changes to it. Pages 28-31 give yousome ideas for producing your own version. Whatare the rules? Ifyou have played an adventure game before you will know what to expect from Haunted House. If youhaven't, all you need to know is that the computer will ask you what you want to do and you tell it, using not more than twowords. Itisa good idea to pick up anything on the way that looks valuable or useful and totry using these thingsin any way you can think of to solve the problems you encounter. Type SCORE to find out how many points you have and if you haveWhat is an adventure game? Anadventure game is like a story inwhich the player is the hero. Unlike a book, where the sequence of events is fixed, an adventure game is different each time itis played because the player chooses what happensat each stage. By giving the computer instructions in response to descriptions which appear on the screen, the player goes ona dangerous journey into anunknown land. The aimis to survive whatever dangers may arise and return with treasures. The first adventure game was written in 1976 ona mainframe computer at Stanford University in the U.S.A. by William Crowther and Don Woods. Itisoften referred to as Colossal Cave, Colossalor just Adventure, anda version of itis now available for most home computers. Itwas written in the scientific computer language, Fortran, which, unlike BASIC, cannot handle words. All the data forthe game had to be indexed and stored on disc. ‘The first people to play adventures were computer professionals, as home computers did not exist. A version of Crowther & Woods’ adventure is still included with most large business computer systems to show people who are not used to computers that they can be “friendly”. These disc-based adventures often occupy more than 250K and are very complicatedto play. Micro adventures There have been many adventures since this first one. Perhaps the most famous are those written by Scott Adams, an American programmer who was the first to produce a version of Adventure for a small micro. This was Adventure Land for the TRS-80. Other Scott Adams’ adventures to look out for are: Pirate Adventure, The Count and Pyramid of Doom The term “adventure” is now used to describe a wide range of different games. The game in this bookis a traditional text adventure based on the Crowther & Woods type of game. The player takes the leading role inthe story, but he is not givenasetof attributes as in role-playing games. The player uses his own intelligence, cunning, and so on, not those of a character assigned tohim atthe beginning of the game. Like chess, traditional adventures are “mind” games, involving puzzle-solving rather than quick reactions or chance. Graphics adventures The original adventure did not use any graphics, relying instead on the player's imagination to conjure up the monsters and other terrors that make up the game. Some people think that a game with graphics is nota true adventure, though there are some very good graphics adventures now available for micros. If you have sufficient memory, you could add graphics routines to your adventures or to the Haunted House program in this book. This book does not explain how todo thisbecause graphics instructions vary so much from computer to computer.What kind of program is it? Anadventure programis really a kind of database. A database is a computer filing system which stores information and allows it to be called up ina variety of different ways, and it can have all kinds of serious uses. An adventure program is an “interactive” database. The player moves through it, altering or “updating” information as he does so. As you work through the book, you will see how particular words are used as “keys” to unlock certain items of information. This technique can be used to restrict acce: to certain information ina “serious” database. You canlearnsome useful programming techniques by writing an adventure. As the programis sucha complicated one, it shows how important itis to planit in detail before switching on your computer. Italso makes you think of allthe things a person using the program might try to do. Ifyou work out a way of making the computer deal with any input, however silly, you will be able to write programs which don't crash. Many of the adventures you can buy oncassette are written, at least partly, in machine code. This allows more information to be packed into the computer and makes the game run faster. If you know a bit about machine code, you could experiment with adding machine code routines to your adventures. ‘Tum the page now and start planning your adventure game,PLANNINGA GAME Where to start When you write an adventure game youare book has 64 locations with short inventinga fantasy world where youmake descriptions. upallthe rules. Youdecide where itis, what Alocation canbe indoors or outand. sort of creatures and things live there and could be a room, a cave, half way alonga what these creatures and things can and passage, an area of forest, the middle ofa cannotdo. Yourworldcanbeanaliencity, _ field, or anywhere else youlike. Itis bestto » for instance, or an underground palace decide on the number of locations early on and stick to it, as this affects the whole structure of the game. Makingamap The next stageis t@draw a toughsketch map of yourworldiItmeed not be accurate tothe last detail but should show the overall scale. While you are doing this, think of where elves, wizards and trolls live ora some ideas for good hiding places for mysterious castle whichis the home of treasures and other objects that the dragons and other strange monsters. It) adventurer will need couldevenbeatime inthe pastinvolving_-Hereisaroughsketchmap forthe actual historical people and facts. Haunted House adventure written for this Many adventures use magic ofsome | | book. kind, You can decide how closely your ¥ ‘ world sticks to the rules of the real world and how much magic is allowed. Whatever you choose to do, try to make sure the rules are logical or players will find the game silly and frustrating Having decided ona theme for your adventure world, you then need to decide onthe point of your game. The player might have to escape, or return to acertainplace, with treasures, or he might have to rescue someone, or find a secret place anddo something there (such as defusing the Mad Scientist's Evil Device for Blowing up the World). Dark halt Working out the locations Locked door The areas or rooms through which the - player moves during an adventure are called locations. Later in the book, you will see how these are numbered to put them in the computer. For the moment, you need to remember that the number of locations you can have depends on the amount of memory your computer has. More locations can make the game more interesting, but leave you less memory space for descriptions of them all. The game inthisVaultPLANNING A GAME Drawing a grid The first stage in turning your adventure world into a computer game is totransfer your sketch map toa squared up grid. You need one square for each location, so forts 64 locations, the Haunted House game needs an 8 X 8 grid. This grid will become the master plan for your adventure, so make it as large and clear as possible. Eventually it will show all the locations and the ways in and out of them, and all the treasures and objectsused inthe game. Number each location, starting in thetop left-hand comer. Most computers start counting at zero, so use zero as your first location number. me a a as 3B a a 38 a @ 5 PBREL eso BREE Bee pals)’ et) s)~ « # a ‘You may want to change the position of walls and doorways when you work out the routes the player can take, so startby penciling your map lightly onto the grid. Label each location witha short description, eg “dark cellar” or “dusty room" and then think about the ways inand out of each location. The usual way of marking these is to use points of the compass ~ north being towards the top of the page, south down, east tothe rightand westto the left. By including staircases, ladders or trapdoors in your descriptions, you canuse up and down for some of your routes instead of compass points. This makesthe game more interesting without the need for areal 3D grid. Working out the routes Mark the exits from each location on your Grid, like this Notice that some locations on this grid have one-way routes, so the player cannot retum the way he has come. Make sure there are reasons for these if you use them inyour adventure, even ifthe reasons are magic. InHaunted House the front door slams and locks behind the player once he has entered, so he cannot go outagain. The CORNER OF HOUSE BACK OF HALLWAY SIDEOF HOUSE SITTING ROOM FRONT EW HALL LIBRARY ED <«w FRONT TOWER SLOPING. ‘CORRIDOR
EP Woe DARK SPIRAL ROOM STAIRCASE SDown s cane ass 27 28 4 ~~ 4 @ am | <«w VAULTED Statue TROPHY CELLAR CLIFF HALL Eb
" * AND Y8C>"* THEN WS=HIDS (0S, 1+1,LEW(OS) 1), I-LEN(8) When V$and WSare both filled, —— the loop counter is set toits maximum value to end the loop. 180 NEXT 1 190 IF WS=*" THEN V$=08 Ifthe computer didn't finda gap in the letters then V$ and W$ will i 7 . still be empty when the loop has coo Se a 2 WD ere mneor fe QSand putsitin VB 220 PRINT "SECOND WORD=";WS 230 IF WS="" THEN MS=*VOU ONLY TYPED ONE WORD This section isso you can run th 240 IF W6="* AND VS="* THEN ME=*VOU DIDN'T TYPE word-splitter by itself. It prints out ANYTHING" messages depending on what 250 PRINT HS youtyped in. Run the program 260 STOP and see what happens. 21 *NB This will not work on Sinclair (Timex) computers. See pages 38 or 39.WRITING THE PROGRAM Analysis of input The computer now has the player's instructions stored in two strings V$ and W$, which stand for “verb string” and “word string”. Its nextjob is to check these against the words you have given it in the initialization procedure on page 18. It assumes the word in VSisa verb and loops round seeing if it matches any of the verbs in the array V$( ). (Notethe difference between the string variable V$ and the array VS(_)- they are completely different things to the computer, so make sure you don't confuse them.) The computer then loops round in the same way trying to match up W$ with one ofthe words in the array OS ). Here is the section of program which checks for a match between the player's words and the wordsin the computer's memory. VBisanew variable set up to record the boxnumber containing the matching verb. Ifthe player typed GET, for example, the computer looks through V$(_) until it reaches box 10 where GET is stored. So, in this case, VB= 10. I've found it - its in 10. ‘The computer loops round V times (V isthe number of verbs in the computer's 20 FOR I=1 TOV 30 IF VS=¥811) THEN VB=1 memory), comparing the player's verb with 4Q NEXT 1 each of those in its memory, Ifit findsone that matches, it sets VB to the appropriate number. The loop for W$ works in the same way, using OB to record the box number of the matching word. 70 IF WS=08(1) THEN OB=] 80 NEXT 1 What if the words don’t match? Ifno match was found, then VB and OB will Silly combinations still be zero. The computer takes this as meaning that box zero in the array contains the match for the player's word, But whenit looks there to find out what the matching wordis it doesn't find anything because you left this box empty when filling the arrays 22 Notice that this matching-up process only checks if the two words are inthe computer's memory. It doesn't check to see ifthe combination of words makes sense. A silly combination such as UNLOCK CANDLE gets through this stage of the program, but will be rejected later on when 1 computer tries to carry out the action. It much quicker just to check the separate ords at this stage than to tell the computer to check for valid combinations. Atthe end of this section of the program, the computer has a value for VB and a value for OB. You can see what it does withthese over the next page.Setting up error messages The computer can use the values of VBand OB to see if the player needs to be senta message saying his instructions are no good. This part of the programislike afilter or grader. The player's instructions are fed. through a series of tests. If they don’t pass one of the tests, a new message is put in MS. Ifthey pass through all the tests, MS still contains the message “WHAT?” which was set up in line 220. (Remember that, atthis stage, the messages are just set up, they are not printed on the screen and may be changed again later in the program anyway.) Here are the program lines which setup the error messages in Haunted House - see if you can find them in the main listing. You will need similar lines if you are writing your ownadventure. Remember the message inM$ might be changed again later on inthe program, The first test looks to see if there is a wordin WS (i.e. that the player typed two words) and then checks if the value for OB is zero. This line is to overcome a problem. You cannot GOSUB ona value of zero. But different BASICs vary in the way they cope with being asked to do this. Most ofthem ignore the GOSUB and carry onto the next line. Some, however, such as the BBC, object to the zero and produce an “on range" error. To get round this, VBis changed from zero toa value greater than V (the number of verbs in the computer's memory), and the computer is sent toa “dummy” subroutine. | NEED Two wonDs® ‘This line sets up a message if the player only typed one word and so WSis empty. (If the word is one of the allowed one-word commands, this message will be changed later in the program.) You can't “Kill ghosts": This line sets up a message if the computer doesn't have the verb in its memory, but does have the object. Ifthe computer doesn't have either of the player's words in its memory it sets up this message. 23WRITING THE PROGRAM CiOB)<31 THEN Ms ‘85 (98) ° You don't have candle. Override conditions Sometimes things happen in anadventure which prevent the player from doing anything until he has dealt with them. In these circumstances, instructions which would normally be valid need tobe overridden, so the computer needs program lines which set flags* in its memory to tell it that special conditions apply. InHaunted House, lines 420 to 450 are override conditions. You can see themon the right, with an explanation of how they work Stop work everyone - © 420° IF F128)=1 AND RAIS. AND RNDIDHOS” @ AND VBC>21 THEN MS="BATS ATTACKING!" 7 601d 90 7 430 IF 4 AND RND (2. AND F(28) 1 co THEN F(27)=1 440 TF FC THEN LL=I © 450 IF LLC) THEN F 10) “1 Line 420 Ifbats are present, player isin Rear Turret Room, randorn number isnot 3and player hasn'tused verb 21 (SPRAY) in his instructions, then MBs set to "BATS ATTACKING ' and player cannot goany further in the game. Line 430 Ifplayer isin Cobwebby Room, random number value is | and vacuum cleaner is switched off, then flag is set for paralysing ghosts to appear, ie. F(27)isset to | Line 440 Ifcandle is lit, then light limit counter, LL, is decreased Line 450 If LLis zero, then candle ovoff flag, F(0), is set to zero. Perhaps you can think of other override conditions which could be added here. Branch to subroutines The computer's next task isto attemptto carry out what the player wants to do. Ifit had to search through every possible action until it found the one the player wanted each time, the game would be very slow and boring. To avoid this, you use lots of subroutines —one for almost every verb on the verb list. (A few, such as GET and TAKE, can share the same one.) ‘Youcanthenuse an ON... .GOSUBlineto tell the computer to branch toa different subroutine depending on the value of VB. ON VB GOSUB 500,570,640, 640,680,640, © 1180, 1220, 1250, 1300, 1340, 1380, 1400, 1430, 1480, 1490,1510;1590 *See page 18 for more about flags. caHow the ON. ..GOSUBline works The ON... .GOSUB line on the opposite page works like this. If VB=1 the computer goesto the first line number listed, if VB=2 it goes to the second, if VB=3 it goes to the third andso on. Notice that the last line number listed is a “dummy” subroutine for VB=V + 1 (the value of VB when no matching verb was found in the computer's memory). The line it is sentto just says RETURN and so sends the computer straight back up the programagain. Look at the subroutines on pages 34 to 36 and see if you can work out what they alldo. Here is the procedure for LIGHT (VB= 19) as an example. You will find it at lines 1340-1370. 1 Ifthe object J, word in player's 4 instructionsis 7... then this message is put in MS. 10... .then this message What happens if the objects not candle? Ifthe object the player wanted to use was not CANDLE, but one of the others inthe computer's memory, such as DOOR, then the message in M$ is unchanged from when itwas set up in line 220. When the computer returns to the main program and finds the instruction PRINT MS it will printthe message “WHAT?". Notice that there is noneed to setupa message saying the candle isn't there, as this is already covered in the error messages section. carrying candle AND player is 3... AND player isnot carrying object 8 (candlestick) 5. Ifobjectis candle and playeris carryingiit 6....AND playerisnot carrying object 9 (matches) 8. Iobjectis ss fe, candle and playeris AND player is carrying 11... .and candle owoff flagis changed to | to show itis ht. Back to the main program Although some of the verb routines are longer and more complicated than this one, they all work ina similar way: the value of OBis checked, a special message is setup ifnecessary and then the computer returns tothe main program. It checks the light limit at lines 470 and 480 and is then sent backto the description and feedback section. Here itprints out the message it has put in Mand waits for the next set of instructions fromthe player. 2s26 WRITING THE PROGRAM The GO subroutine The subroutine for the verb GO is solarge and important in an adventure game you could almost think of it as a sub-program. Seven verb commands are directed to it~ GO,N, 8, W, E, Uand D. This routine isalso special because it responds to single-letter direction commands as well as two-word ones. You don''t have to include this facility inyour program, but it does help make the game quicker and more interesting to play. Ifyou've played many adventures you will realize how tedious it is to have to type GO NORTH etc. every time. This is how the GO routine works. ‘This is how the GO routine works. oto 0 0 FOO THE 1 OR19 THEN 270 1F E20 THEN 680 TF OF ‘Youcan see now why directions were included on both the verb and the abject SH! OU FELL QUT OF THE THEE FETUN AND tS THEN He" RETUR HT TF CU15)=1 ANE NOT TEN nb="YOU CAN'T CARRY & B08 40 1F 46 2 eno FETA of cotta First, a variable Dis set up tohold information about the direction in which the player wants to move. Its values 1 to6 correspond to north, south, west, east, up and down. The next line checks to see if the player just typed one word and then gives Da value depending on the value of VB. (Notice that by taking 3 away from VB, the computer gets values for D which correspond to those inlines660t0710.) The next six lines check if the player typed a two-word direction instruction. They use the value of OB to set the value of D. As this is not really a 3D adventure, the UP and DOWN instructions need tobe converted into north, south, east or west. Lines 720 to 770 do this. (If you check back to the master plan on pages 14to 15, youwill see that this does work.)F(14)=1, 50 hhe's up the Lines 780-840 The computer also needs to check if there Ifthe player is in location 82 and the ghost are any special conditions whichaffectthe __flagis “on thena message is sent tosay he player's ability tomove. For example if cannot move. Each of these conditions F(14)=1, then the playeris atthe top ofthe _returnsthe computerto the main program. tree. Ifhe tries to move without first See if you can work out what the rest of the climbing down, he getsamessage saying _lines inthis section do. he has fallen. Thisisa flag for the computer to use toregister Checking for walls whether it has found the exit the player wants. RL is anew variable which holds the length ofthe string which it finds in R$(RM). (Thisstringiis the routes, NSW etc., for the location the player isin.) Ifthe move has not been stopped byany of these special conditions, the computer must check that there isn’t a wall or anything else blocking the way. eare the lines which dothis. They look quite complicated at rst sight, but if you look carefully] each part, remembering what \ the variables are, you should pe able to see what ishappening. ‘Computer loops round RL times. Each loop, computer takes one of the charactersin RS(RM) and temporanily calls it US. Itthen runsa seriesof tests on USand D. Ifthe player's direction instruction matches an exit inthe location he isin, then the value of RM is changed to move him to the appropriate place. F(35)is then set to | to stop the computer trying to change RMagain onanother trip through the loop. (If youthink carefully, you will see that this could be possible as the computer uses its new value of RMin line 870.) Ifyou check the master plan, you will see how adding or subtracting ] or 8 moves the player to the correct next location Aithe endof the lo 10 "OK". Thiswill replace the "INE! ORDS' message set in the error messages if the player typed aone- word direction, 50 F{35)=02RL=LEN(RS (RM) ) a0 FOR I=1 TO RL 270 US=HIDS (RS (RK) 1, 1) 980 IF (US=*NP AND D=1 AND F(35)=02 THEN RMN=RN-8 PHD F(35)=05 AND F(35)=0 If F(86) isstill zero, then the direction the player ‘wants to go is not allowed and M$ is changed to say so 930 Ns="0K" IfDisless thanone (ie. itwasn'tassigned a value in 980 IF F(35)=0 THEN MS="CAN'T 6D Jines 650 to 770), then MS is changed to “GO WHERE? THAT WAY" This line makes the front doora ‘once-only” 950 IF D¢1 THEN M8="G0 WHERE?* When the player enters location 4 (the lobby. 960 IF RN=41 AND F(23)=1 exits from location 49 (front porch changed THEN RS (49 6-"THE DOOR Pefrom "NSW" to "SW", MS isset to "THE DOOR SLAMS SHUT!*: SLAMS SHUT’ and the flag for the front door isset 970 RETURN tozero to show the computer it is now closed. (The routes from location 4] donot need to b d because $ wasn't included in them in th 2728 MAKING CHANGES Changing the program ‘Youcan change the program in this book as muchas you like, either to produce variations on the haunted house theme orto create games with completely different settings, descriptions, objects, verbs and messages. Remember that the more you change, the more complicated it will get as. youwill have to think about how everything affects everything else. Ifyouare going to write anew game, using this program as a guide, then you should plan it as described on pages 6 to 15 Itis worth spending the time planning out your game properly as youare less likely to find it full of mistakes when youcome torun the program. Itisa good idea to start by makingsmall changes first to see what happens. Ifyou store the master program on tape, youcan make changes, test them and adapt them without losing the original. How much spare memory have you got? ‘The Haunted House program itself occupies about 7K of RAM before itis run. It then needsa further 3Y2to 4K for the arrays tostore the data. Your computer willtake some memory for its own intemal use —up to3K on some models—andit willusea further 1K or more for the screen. (The Spectrum uses 7K which is why Haunted House won't fitinto the 16K model.) So, if youhavea 16K computer, you won't have much memory left over, and most ofthe changes you make will have to be replacements rather than additions. Longer descriptions Ifyou have more than 16K, one of the easiest ways of making the game more interesting to play isto add longer descriptions. Instead of “impressive vaulted hall” for instance, you could say something like “You have entered a vast, vaulted chamber with pillars extending many times your height above you. Light filters in from the east and there appears to be a doorway inthe distance to the west...” Add atime limit Haunted House already has atime limit on the life of the candle. You could add an overall time limit to the game as well by getting the computer to count the number of turns the player has had and stop the game ata preset number. You can do this by adding to line 70and putting an extra line at 488 like this. 10 Vs Youmay not need to dothis as not all computers need new variables to be set up before they can be 7 485 T=T+1: 1F 1>200TREH ~~ fee “MIDNIGHT HAS STRUCK. NABEN YOU'VE TURNED INTO A Bi as You can change this numberto anything you like.Adding sounds computer's sound instructions work. Test some sound routines out first to make sure they are what you want and thenadda GOSUB instruction tothe line where the action occurs, eg IF RM=46 AND C(1)=1 Squeak' \THEN M$=“SOMETHING SCARY IS |HAPPENING": GOSUB 6000 Squeak BATS ATTACKING} You could add sounds for the front door slamming, the secret wall breaking, the key turning in the door, magic happening when youuse the magic word and soon. This Thisis an effective way of adding tothe chart gives a few sound routines for various game without havingtomake complicated —_ computers. The only limit on the number changes. Youwillneedtoknowhow your —_ you can add is memory.MAKING CHANGES Scoring Haunted House hasa very simple scoring system, awarding one point for each object the player is carrying. Youcould change to amore interesting system, such as basing the score on the value of the object. Ifyou assume that the objects are numbered in descending order of value, then the painting will be the most valuable and the key the least. If you change line 1630 like this: 1530 IF C(I)=1 THENS=S+G—I then the painting will be worth 18—1=17 and the key 18—18=0. (Gis the number of gettable objects and lis the number ofthe object the player is carrying.) Thismakes the key valueless as an item of treasure but of great value as a useful object because without it, the player would not be ableto get the painting or the goblet. Ifyou wanted a more flexible system (and you have enough memory), you could set up anarray to contain object values inthe initialization routine, like this: Use any values you like. 30,11, 16, 25,32,8,25,4,9) 1 DATA 30 10512,4,9 DIN T(6) Dimensionsnew FOR I=1 10.6 “| array TwithG i spaces (i.e. number ig a ofgettable objects) ) Also change line 1530 as follows’ 1530 IF C(I)=1 thenS=S+T() Penalties SS So far, the scoring routine has only counted plus points and not been affected by silly things the player might try todo. You could adda penalty system quite easily by using a counter, say MK, for mistakes. Whenever the player does something really silly, you add toMK and then subtract it from $ when the score is worked out atline 1830. Ifthe player falls out ofthe tree, for instance, you could award one (or more) penalty points like this 780 IF F(14)=1 THEN NS="CRASH YOU FELL QUT NK#+1: RETURN Don't forget that some computers need new variables to be defined before they can beused. Youcan do this by adding MK=0 tothe variablesin line 70 Saving the game Itwould be niceto beable toswitch off part way througha game and then carry on later from where youleft off. With long, complicated games this is avery important feature and you can include it by adding SAVE and LOAD tothe verb list. In ine 70, change the value of V to 27 and add the two new verbs, separated by commas, tothe end ofline 1665. You will also need to change the ON GOSUB line at line 460.Putthe line numbers of the twonew subroutines (one for SAVE and one for LOAD) between the last two numbers inline 480 so that they read: 1510,3000,4000, 1890 First new number Second new number Then add the new subroutines like this, checking your computer’s manual to make sure the wording is correct. INPUT “13 your CASSETTE EADY 10 RECOROTr YS Joo IF Ys "7" THEN 3000 3020 OPEN FILE FOR OUTPUT FAOM coveure This saves the room the playerisin. Replace thisline with your computer's own instructions. You may noteven need 3050 PRINT 41,8 ‘This loop saves positions of Gettable objects. 1106 0 PEINT AL, at NEXT worm oy FMT HUH FU) 0 MENT I So se en) 9 Ta } WEI000 INPUT "ARE YOU READY TO LOAD*:YS: 3 ‘1 q This saves items the player is carrying and the state of the flags. 4050 INPUT 4#1,LE 040 NeXT 1 4070 FOR 21 10.8 4090 INPUT 1,011), 0 MELT I LOSE RETURN Note that this save routine does not save the descriptions and routes in the game. This means that the rooms and routes altered by the player's actions will return to their original state - the secret wall will be rebuilt, the door relocked and so on. (The ghosts are probably responsible.) You could save the D§ and R$ arraysif you wanted to, by adding extra loops to eachof the SAVE and LOAD routines. Do you give in? Like most adventures, Haunted House contains traps for the player which canonly beavoided by using a certain object ina certain way. Ifthe player doesn't have that object he is stuck. A “quit” feature would be useful in this situation so the player does not have to press BREAK or ESCAPE to end the game. You can do this by adding QUIT to the verb list and putting in a new subroutine, as for SAVE and LOAD described onthe left. ‘You must remember to change the value of V in line 70, add QUIT to the endof line 1666 and insert the new subroutine line number in line 460, putting it in the second tolast position. The QUIT subroutine should be something like this: S000 INPUT "WANT TO QUIT*;O$ S010 IF Q&C>*Y" THEN RETURH 5020 INPUT "LIKE 70 SAVE GAME FIRST*,OS 5030 IF Q8="Y" THEN GOSUR 3000 ‘Youdon'tneed this if you haven't put the SAVE feature in. 5040 PRINT "THANKS FOR PLAYING" 5050 END Notice that there is no RETURN at the endof this subroutine. This is usually against the rules in BASIC but, in this case, the computer cannot get confused because the program will no longer be running when it reaches line 8050. 31 ‘if you havea BBC, you may need to replace semi-colon with acomma.32 MAKING CHANG Debugging your adventure If you write your own version of Haunted House or use the routines inittomake anew adventure, then you are quite likely to make mistakes. Finding mistakes and putting them right is called debugging. Here are some of the problems you might come across andsome suggestions for fixing them. Comma missed out. Error here. Ifyou get an array error, it means that you didn'treserve 6) enough space when you DIMmed the array or you BIH F(3) accidentally put an extra item in the DATA statement FOR I=1 TO 4 (perhaps by putting in an extracomma)andthencounted READ AtI) this extra item when working out the number forthe READ NEXT 1 loop. DATA AKE, COFFIN, BLOOD, KEY This could happen because the program is being directed to the wrong subroutine by the ON GOSUB line. Check each number in this line against the subroutine with thesame number. If these are all correct, check the DATA statement for the verbs to see iftheir order coincides with the order of the subroutines. Ifthe program is going to the correct verb subroutine and the verbs are listed inthe correct order, check that there is a RETURN line at the end of each subroutine. If thisis missing, the computer will “fall through" the program to the next subroutine down which may produce some strange results. Ifnone of the above things solves the problem then check through the conditions in the subroutine carefully. You might have missed something out or got a sign wrong or used the wrong variable by mistake. Check the override conditions and flags which occur earlier in the program too. Ifan object appears in the wrong place then you've probably made a mistake in thedata for array L, If an object doesn't appear at all, check the flag array. You must have setthe | flag with that object number to 1, which means that the object is there but the computer won'ttell you, You need to set the flag to zero. Check the initialization routine where the flags are set up and then the flag references throughout the program.DESCRIPTION & FEEDBACK INPUT & INPUT ANALYSIS PROGRAM LISTING The Haunted Houselisting Thisis the program listing for the Haunted House adventure. It should run onany computer which uses Microsoft-style BASIC and which has a minimum of 16K of RAM. You may have to make a few minor changes for your computer —look out for comments nextto certain lines in the listing. If you have a VIC 20 or an Oric, there are a few extra lines anda line change which you will find at the end of the listing on page 37. If you have a BBC Model A,usemode7. This listing will not work as it is on Sinclair (Timex) computers. If you have aSpectrum (Timex 2000), turn to page 38 for changes to make to the program. If you have aZX81 (Timex 1000) there is a special listing for you on pages 39 to 45. Asthis isa long program, you will have to be extremely careful when you type it in. The smallest mistake could prevent it running properly and will be very difficult to findonce you've typed the whole program in. Check each line as you go, especially the ONGOSUB and DATA lines, Some of the program lines are so long that they take up two or morelines onthe printed page. Look out for these and make sure you do not press RETURN or ENTER until the end of the program line. Ityouhave a VIC 20, change CLSto PRINT CHRS(147). Ifyou have an Apple change it to HOME. 10 REK HAUNTED HOUSE ADVENTURE 20 REM #eeeEEEHEEReEeEEEOHEEE 30 REM THIS VERSION FOR "MICROSOFT" BASIC 40 REM REQUIRES A MINIMUM OF Lak 50 REM SELECT "TEXT NODE" IF NECESSARY 40 REM #eeeteetsnseeeeeeseensnersries: 65 CLEAR 100 70 V=25:W=3626=18 80 BOSUB 1400: [790 cus:PRENT HAUNTED HOUSE 100 PRINT * Line 70 sets up the variables. V is number of verbs, Wis number of object words, Gis number of “gettable” objects. |] 119 PRINT *vouR LocaTzon* 120 PRINT DS(RM) ieee 130 PRINT "EXITS: "5 So initialization roulne 140 FOR T=1 TO LEN/RSARM)) 150 PRINT MIDS(RS4RM 1,1 See page 20t0find out 160 NEXT 1 how the description and 170 PRINT feedback section works. 180 FOR I=1 10.6 190 IF L(I)=RM AND F(1)=0 THEN PRINT “YOU CAN SEE "3080125" HERE™ 200 NEXT 1 fi 210 PRINT " hin, > 220 PRINT MézMS=*WHAT® Ifyou have a BBC, you 230 INPUT "WHAT WILL YOU 0 vouris- imynesl scone 240 ¥ 208-0 250 FOR I= TO LEN(OS) 260 IF MIDS{QS,1,1)=" * AND VS="*THER YS=LEFT# (GS, 1-1) 270 TF MIDS{O$,1+1,1)4)" * AND VS<)"* THEN WS=MIDS(QS, 1+1,LEN(O$) 280 NEXT 1 290 IF W5="" THEN VS=05 See pages 21-22tofind 300 FOR I=1 TOV out how the input section 310 IF ¥S=2¥8(1) THEN YB=I works. 320 NEXT 1 330 FOR I=! 70 W ¥ 340 IF WS=O8(1) THEN LET OB=1 33BRANCHTO __ ERRORMESSAGES VERB 1 ‘VERB 2 VERBS 3-9 34 SUBROUTINES _OVERRIDE CONDITIONS PHOGRAM LISTING (350 NeIT 1 60 IF W8>"* AND OB=0 THEN MS=*THAT?S SILLY" Loe 370 1 vbzo THEN yB=ve1 Stes ( |] 390 IF ws=** THEN MS=*1 NEED TWO WORDS* See pages 23-24 tofind out howthe error messages section works. 390 IF YB)Y AND OBO THEN MS="YOU CAN'T "4054"? 400 IF YB>V AND OB=0 THEN MS="YOU DON’T MAKE SENSE* 410 1F YBCV AND 080 AND C(OB)=0 THEN MS=*YOU DON’T HAVE "*# 420 IF F126)=1 AND RM=13 AND RND(3)<23 AND YBC)21 THEN MS="BATS ATTACKING!*: GOTO 90 0 1F RM=44 AND RAD(2)=1 AND F(24) C1 THEN F(27)=1 440 TF FUO)=1 THEN LL 450 IF LCL THEN F(0)=0 2 Use your computes formof RND her 450 ON YB GOSUBS00,570, 640,840,640, 64058 1300, 1540, 1380, 1400, 1430, 1480, 1490, 1510, 1590 / "470 TF LL=10 THEN NS="YOUR CANDLE 1S WANING!* 480 TFLL=1 THEN MS="¥OUR CANDLE 18 QUT!* 490 GOTO ‘ on 00 PRINT*WORDS I KNOW: \ > _f Jv? Change this line for VIC 20 and Oric. See page 37. 510 FOR I=1 10 ¥ 520, PRINT VSI);","s 530 NEXT I S40 HB="* PRINT 550 GOSUBISE0 560. RETURN 570 PRINT*YOU ARE CARRYING: " 580 FOR I=1 10 6 590 IFC(I)=1 THEN PRINTOS(I);*,°5 400° NEXT T 610 MS="":PRINT 620 G0SUB150 ‘Take extra special care totype this line correctly. It will mess up the game if you get it wrong. The branch to subroutines section and the verb subroutines are explained on pages 24- 28. 630 RETURN 19 D=0 650 IF OB=0 THEN D=VB-3 660 IF OB=19 THEN D=t 470 IF QB=20 THEN D=2 680 IF OB=21 THEN D=3 69 IF OB=22 THEN D=4 700 IF OB=23 THEN D=5 710 IF OR=24 THEN D+ 720 IF RM=20 AND 730 IF RI 740 IF Ri 750 IF RM=22 AND 7h0 IF R=36 AND 770 JF RH=36 AND D=5 THEN D=2 780 IF F(14)=1 THEN MS="CRASH! YOU FELL OUT OF THE TREE! ":F(14)=:RETURN 790 IF Fi27)=1 AND RM=52 THEN MS="GHOSTS WILL NOT LET YOU MOVE"SRETURN 800 IF RM=45 AND C(1)=1 AND F(34)=0 THEN M="A MAGICAL BARRIER TO THE WEST":RETURN 810 IF (RM=25 AND F(O)=0) AND (D=1 OR D=4) THEN HS="YOU NEED A LIGHT*sRETURN THEN D1 ‘You can find out how the GO subroutine workson pages 26-27.VERB 12 VERBS 10&11 ‘VERB 13 VERB 14 VERB 17_VERB16 VERB 15 820 IF RM=54 AND C(1S) <>t THEN MS=*YOU'RE STUCK!*:RETURN 930 IF C(15)=1 AND NOT (RN=53 OR RM=S4 OR RM=SS OR RM=47) THEN MS="YOU CAN'T CARRY A BOA IT!" RETURN 840 IF (RM>26 AND RA¢3O) AND F(Q)=0 THEN HS="T00 DARK TO MOVESRETURK 250 F(35)=02RL=LEN(RS (RM! 860 FOR I=1 TO RL 270 USHIDSIRS(RM) 1,1) 880 NY AND D=1 AND F(3S)=0) THEN RM=RM-B:F (35) 890 IF (US=*S* AND D=2 AND F(35)=0) THEN RM=RM+B2F (35)= 00 ‘ AND F(35)=0) THEN RMERN-1:F (35 Ifyouare using a VIC 20, youcould shorten the messages to 22 90 AND F(35)=0) THEN RM=RMEISF (35 characters ormake sure 920 NEXT 1 the spaces fall inthe 5 . right places sothe 930 Hs="Ok messages look better on 940 IF F(35)=0 THEN MS="CAN'T GO THAT WAY!* 950 IF D¢1 THEN MS="60 WHERE?" 960 IF RM=$1 AND F(23)=1 THEN RS(49)="SW*:MS="THE DOOR SLAKS SHUT!*:F(23)=0 970 RETURN 77980 IF OBDG THENNS="1 CAN'T GET "+W$:RETURN 985 IF L(OB) <> RM THEN MS="IT ISN’T HERE* 990, IF F(QR) <0 THEN MS="HHAT "+W8+"2" 1000 IF C(OB)=1 THEN M$=*YOU ALREADY HAVE 1T* 1010 IF OBDO AND L(DB)=RM AND F(OB)=0 THEN C(OB)=1:L(OB)=65:MS="¥OU HAVE THE “##8 1020 RETURN [030 IF RM=43 AND (OB=28 OR OB=29) THEN F (17 1040 IF THEN MS="IT’S LOCKED" 1050 IF THEN MS="THAT'S CREEPY! *:F(2)=0 the screen. :NS="DRAWER OPEN* NE="SOMETHING HERE!” 1080 IF OB: "THAT'S DISGUSTING!" 1090 IF (DR=28 OR OB=29) THEN MS="THERE 1S A DRAWER" 1100 IF OB=33 OR OB=5 THEN GOSUBL140 1110 IF RM=43 AND OB=35 THEN MS="THERE IS SOMETHING BEYOND. .* 1120 IF OB=32 THEN GOSUBL O30 1130 RETURN T140 IF RM=42 AND OB=33 THEN MS="THEY ARE DEMONIC WORK: 1150 IF (OB=3 OR OB=36) AND C(3i=1 AND FC34i=0 THEN "USE THIS WORD Use your computer's 1160 IF C(5)=1 AND OB=5 THEN MS="THE SCRIPT 1S IN AN ALIEN TONGUE" | formofRND here. 1170 RETURN 180 HS=*OK *mewse"?* 1190 TF CCS)=1 AND OB=S4THENNS= "MAGIC OCCURSE":IF RACDAS THEN RR=RND(63)— 1200 IF C13)=1 AND QB=34 AMD RMSSS.THENF(3$)=1 > 1210 RETURN CL 1220 IF C(12)=1 THEN MS="¥OU MADE ® HOLE* 1250 TF C(12)=1 AND RM=30 THEN ME="DUG THE BARS OUT*:084RH)="HOLE IM BALL*ZRS RH)="RSE* 1240 RETURN 1250 IF C(14) <1 AND RM=? THEN ME=*THIS 1S NO TIME TO PLAY GAMES? 0 IF OB=14 AND CIL4)=t THEN Mé=*¥OU SWUNG IT" 70 IF QB=13 AND C(1S)=1 THEN MS=*#HOOSH!* 35VERB 23 VERB 22 VERB 21 VERB 20 VERB 19 24 VERB 25 INITIALIZATION VERB 18 PROGRAM LISTING 1280 IF OB=13 AND CCLS)=1 AND RM=43 THEN RSIRK)="WNTSOSiRM)="STUDY WITH SECRET ROW": YOU BROKE THE THIN WALL" ‘avo RETURN IF THEN AND C114) TT ISN'T ATTACHED 10 ANYTHING!" 310 IF AND C SING RM=7 AND FiL4)=0 THEN MS="YOU SEE THICK FOREST AND CLIFF SOUTH*SF (14) =1sRETURN 1320 IF AND C(14) Cot AND RH=7 AND F(14)=1 THEN MS="GOING DOWN!":F(14)=0 1330. RETURN “IT WILL BURN YOUR HANDS" NOTHING TO LIGHT IT WITH 1380 IF Fig)=1 1390 RETURN 1 THEN F (0)=0sMS="EXTINGUISHED" "6 AND C(16)=1 THEN MS="HISSSS" ANDC(L)=1 AND F(25)=1 THEN F(26)= 1410 IF OB: 1420 RETURN 430 TF OB=10 AND C(10)=1 AND C(L1)=1 THEN MS=*SWITCHED ON*:F(24)=1 1440 IF F(27)=1 AND Fi24)=1 THEN MS="WHIZZ~ YACUUMED THE GHOSTS UP 450. RETURN 460 IF RM=43 AND (OB=27 OR OB=28) THEN GOSUBLO30 1470 IF RM=2B AND OB25 AND F(25}=0 AND C41G)=1 THEN F(2S)=12R8(RM)="SER":DS(RM)="HUGE OP JEN DOOR*:M$="THE KEY TURNS!” 480 RETURN 1490 IF C(OR)=1 THEN C(OB)=02L (0B) =RM: 500 RETURN 1510 $=0 1520 FOR 1=1 10 6 1530 IF C(1)=1 THENS=S+1 1540 NEXT 1 1950 IF S=17 AND C(15)¢21 AND RM
" * AND 290 IF WS="" THEN LET 18-08 295 IF LEN({$) > LENIVS41)) OR KS="* THEN GOTO 325, 296 LET ES=¥S4FS( TO (LEN(YS¢L))-LEN(KE2)) 310 IF ¥8=V8(1) THEN LET YB=1 * OR LEN(WS) 2LEN(GS(1)) THEN GOTO 240 sS+F$( TO (LEN(OS(1))-LEN(HS) )) THEN 6070420 AND RASS AND INT (RMD joe SH103 AND YB O21 THEN LET MS="BATS ATTACKING / ° > 30 IF RM=44 AND INT(RNDI2) 440 IF FC20)=1 THEN LET UU AND F(24)¢31 THEN LET FC27)=1 LS +1 450 IF LUCITHEN LET F(20) ————* 460 GOSUB S0OK YR=L1245708 (VEZ AND VBC1O) +9808 (UB=E0 GR YB=11)+10308 (VB=12) 410708 (VBE13) +1 1404 (RES) 411808 (VB=15) #12208 (yB= 14) #12508 (9 LADOE (VB=21] 414308 (YR=22) +1 4604 (VB=23) 414908 (YR=24) #15108 (VB=25) #15908 (VB=26) 800 IF (RM=26 AND F(20)=0) AND (D=1 OR O=4) THEN LET M$="YOU NEED A LIGHT*: RETURN 849 IF (RHD26 AND RN<30) AND F(20)=0 THEN LET MS=*TO0 DARK TO MOVE": RETURN 850 LET F¢ LET RL=LEN(RE(RM#L) | 870 LET US=RERMEL) (7 TD 1) 1 THEN LET R$(50)="SW"SLET MS="THE DOOR SLAMS SHUT!*:LET F(23)=0 OR OR=0 THEN LET MS="I CAN'T GET "#¥8:RETURN 1 AND OB=34 THEN LET NS="#MAGIC DCCURSH "SIF RMCO45 THEN LET RM=INT(RNDEOA) THEN LET X8=08( TO I-1} "THEN LET WS=O$(T+1 TO) sLET T=LEW(Q8)-1 Remember that if you type in the data incapital letters, you must play the game using capitals the computer does not recognize that "GO WEST” and “go west” are the same thing. Itis best io keep the caps lock on allthe time. TF C1t2)=1 AND RM=30 THEN LET MS="DUG THE BARS QUT*:LET DS(RM+1)="HOLE IN WALL"SLET ASIRMELI="NGE" 1286 1F @ 1 AND THEN LET RE¢RN#L)="MN"SLET DS(RM#LI="STUDY WITH SECRE T ROOM ME="VOUE BROKE THE THIN WALL" 17 AND CUT)=1 AND CéFi=1 AND C(B)=1 THEN LET M8="IT CASTS A FLICKERING LIGHT* 1 THEN LET F(20)=0sLET MS="EXTINSUISHED® ‘28 AND OB=25 AND 18)-1 THEN LET F(25: UGE OPEN DOOR":LET MS="THE KEY TURNS!" 1800 DIM RS(64, 4) 20TH DS (54, 4) 2DIM O8((H,13) 201K Y8(Y,9) LET RSCRMHL)=*SEW"SLETZX81 (Timex 1000) version The program listing on the next six pages is aspecial version of Haunted House forthe ZX81. It sticks as closely as possible tothe structure of the main program, so youcan follow the explanations of the program given throughout this book, The main 2 Notice that the locations are numbered starting with 1, as the ZX81 will not allow youto use the zero box in an array. ba 2X81 masterplan 1 2 3 ENTRANCE SCULLERY TOKITCHEN KITCHEN ROOM WITH RUBBISH SITTING ROOM FF CORRIDOR gS differences are that the ZX81 will accept only one statement on each line and itdoes not have the commands READ... .DATA. The program has been rewritten totake account of these and other differencesin the BASIC which you will see pointed outon the listing. These changes take up quite a lotof memory space. In order to make the game fit, the number of locations has been cut from 64 to 36 and otherdata changed slightly to fit with this. The 2X81 version of the master plan is shown below. You can find out how the data is put intothe computer's memory over the page. 10 SPIRAL STAIRCASE SLIPPERY STEPS COBWEBBY ROOMx81 LISTING How to use the program Ifyou look through this listing, you will notice that the data for the game is not incorporated in the program. The program works by asking you to type in the dataand then saving the whole program, including the data, on tape. You only need dothis ‘once —next time you want to play the game, all you have to dois load the tape. Follow these instructions to use the program: 1. Type in the program (very carefully). 2, Type RUN 2440. 2200 "HAUNTED HOUSE ADVENTURE" "YOUR LOCATION: * 60 PRINT DS(RM) 70 PRINT "EXITS:" 80 FOR I=1 TO LEN(RS{RN)! 90 PRINT RS(RM) (1 TO 15%," 100 NEXT I 110 PRINT 120 FOR I=! 130 1F LAT 140 NEXT 1 150 PRINT 180 PRINT ME 170 LET MS="WHAT 2" TRO PRINT "WHAT WELL YOU DO NOW" 190 INPUT Os 200 LET 1$="* \ 210 LET Wee" \ 20 LET VB 230 LET 08: 240 FOR J=1 TO LEN{OS)-1 250 IF Q8(1 TO 1)=* " AND X$= 260 IF QS(I+L TO 1+1)4)" © AND X80 270 IF WS¢>"* THEN LET T=LEN(@S) -! 280 NEXT I 290 IF WS="* THEN LET x6=05 300 IF LEN(XS) 2LEN(VS(1)) OR XS ‘310 LET F=LEN(VS(1)) -LEN (KS) 520 LET IS=X84FS 170 F) 330 FOR I=1 TOV 06 DESCRIPTION & FEEDBACK INPUT & INPUT ANALYSIS THEN LET X$=08(T0 1-1) THEN LET WS=08(1+1 TO) THEN GOTO 420 3. Now type in the data in the following order (see page 48 for lists of data) a) location descriptions b)routes ) object words @) verbs The program stops after each section so you can re-enter any data which you put inincorrectly. If, for instance, you want to putthe verb data in again, type GOTO 2720. If you want to carry on to the next input section, type CONT, followed by NEWLINE. 4, Now SAVE the program ontape. This will save all the data as well 5. Tostart the game, type GOTO 10. DO NOT TYPE RUN, as this will destroy all the variables. 6, Now input the starting positions of the objects. When you input the last ofthese (18) the program will give you your starting location. 7. Foranew game, repeat steps § and 6. 8, When you load the program from tape, start these instructions at step 5. RN AND F(1)=0 THEN PRINT "YOU CAN SEE *308(1)3" HERE ‘The ZX81 needs LET whena value is assigned to a variable. This section looks a bit different to the main program because the ZX81 does not use MIDS, LEFTS and RIGHTS to take a section of astring. 340 IF $2V8(1) THEN LET VB=I 350 NEXT 1 40] | 360 IF WS="* OR LEN(WS)2LEN(0$(1)) THEN GOTO 430ERROR MESSAGES OVERRIDE CONDITIONS BRANCHTO SUBROUTINES: VERB 1 VERB 2. VERBS 3-9 370 LET FSLEN{O8 (1 380 LET WSHS+FS(TO F) 390 FOR I=1 TOW 400 IF (1) THEN LET OB>I 410 NEXT I EN (WS) Notice that some of the mat o - - . program lines are longer than "220. IF WS)"* AND OB=0 THEN LET NS="THATS SILLY the printed lines on the page. 430 IF YB=0 THEN LET ¥B=¥el Make sure you don't press 480 IF WS="" THEN LET MS="! NEED TWO WORDS* NEWLINE before the end of 450 IF VB)Y AND OBD0 THEN LET MS="YOU CANT "+05 {he program|ine. 460 IF YBDV AND OB=0 THEN LET MS="YOU DONT MAKE SENSE" 470 IF OB-0 OR O86 THEN GOTO 490 480 IF YB
0 AND C(OB)=0 THEN LET MS="YOU DONT HAVE "+HS 490 IF F(26)=0 OR RMC)S OR INT{RND®S)=2 OR VB=21 THEN GOTO 520 a OoN 500 LET MS="BATS ATTACKING" 510 GOTO 20 LZ) 520 IF RM=29 AND INT(RND#2)=1 OND F(24)=0 THEN LET F(27)=1 t 530 IF F(20)=1 THEN LET LL=UL- <7 540 IF LLG1 THEN LET F(20)=0 r 50 GSU S90¥(VB=1) +6608 (VB=2) #7308 (VBD2 AND VB{10)411408(VB=10 OR VB=11)+12708(VB=12) +13508 (VB=13) +14408 (VB=14) #14804 (VB=15) +1540# {WB=1 6) #1560#(VB=17) #16408 (V B=18) #17008 (9B=19) +1950 (VB=22) 419208 (VB=23) #19908 (VB=24) +2040# (VB=25) +21908 (VB=26) #17608 (VB=20) +1808 (VB: 560 IF LL=10 THEN LET MS="YOUR CANDLE 1S WANING" /OUR CANDLE IS QUT* 570 IF LL=1 THEN LET 580 GOTS 20 ‘This line reple the ON 90 PRINT "WORDS I KNOW" GOSUB line, which the ZXB1 600 FOR I=1 TOV cant de ewer like one long cee ce lation, using the value of 610 PRINT VS(1)5","5 VB. The computer looks at 620 NEXT T each of the brackets containing 630 LET MS="" “VB: 7 nd puts ifthe ‘ bracket is true and a zero ifit 640 GOSUB 2160 * 72 rorking through the 650 RETURN Calculationusing a particular calculation using a particular 60 PRINT “YOU ARE CARRYING: * value of VB to see how it works. 670 FOR I=1 106 680 IF CUI)=1 THE! 690 NEXT 1 700 LET 710 GOSUB 2160 20 RETURN 730 LET D=0 740 1F 0B=0 THEN LET D=VB-3 750 IF OBD18 AND 0825 THEN LET 760 IF RA=10 AND D=5 THEN LET 770 TF RM=10 AND D=6 THEN LET D=3 780 IF RM=12 AND 790 IF RM=12 AND D=5 THEN LET 7 AND D=6 THEN LET O-t iy: 2 AND DeS THEN LET D2 820 TF RNGO32 OR D693 THEN GOTO 850 830 LET MS="ITS & LONG DROP* 41 INT 08405", "5 B18 ‘This replaces the tree section inthe main program. Check the plan if you want to see what location 32s.VERBS 10 & 1] VERB 12 \ 2X81 LISTING 840 RETURN 850 IF F(27)=0 OR RMC>S4 THEN BOTO 880 860 LET MS="GHOSTS WILL NOT LET YOU MOVE" Check each line before you press NEWLINE. Itis much 70 RETURN easierto try and spot your kd mistakes as you type than 880 IF RMC>29 OR C(1)=0 OR FU34)=1 THEN GOTO 910 having to search through the 890 LET MS="MABICAL BARRIER TO THE WEST" whole listing to find them 900 RETURN 910 IF RMC14 OR RADI? OR F(20)=1 THEN GOTO 950 14 AND D¢>L AND DC>4 THEN GOTO 950 00 DARK TO HOVE* 940 RETURN 950 IF C(15)=0 OR RNCY36 THEN GOTO 980 960 LET MS="THE BOAT IS TOO HEAVY" 970 RETURN 980 LET RL=LEN(RS(RM)) 990 LET OM=RN 1000 FOR I=1 TO RL 1010 LET US=RS(RM) (1 TO 1) 1020 IF US="4* AND D=1 THEN LET OM=OH-6 1030 IF * AND D=2 THEN LET ON=OM+6 1040 IF W" AND D=3 THEM LET OM=OM-1 1050 IF US="E* AND D=4 THEN LET ON=OM#L 1060 NEXT T 1070 LET MS=*0K" 1080 IF RN=OM THEN LET MS="CANT 60 THAT MAY" 1090 LET RH=OM 1100 IF D(1 THEM LET MS="60 WHERE 2* 1110 IF RMCO25 OR F(23)=0 THEN GOTO 1150 1120 LET RS(31)=** 1130 LET MS=*THE DOOR SLAMS SHUT BEHIND YOU" 1140 LET F(23)=0 1150. RETURN 1160 IF OBD0 AND OB(=6 THEN GOTO 1190 1170 LET M$="YOU CANT GET “#H$ 1180 RETURN 4190 TF L(OR) CORN THEN LET MS="1TS NOT HERE" 1200 IF F(OB)=1 THEN LET MS="WHAT "#¥S#" 2° 1210 IF C(OB)=1 THEN LET MS="YOU ALREADY HAVE IT" 1220 TF L1QB)<¢RN OR FIOB)=1 THEN GOTO 1260 1230 LET C(OB)=1 1240 LET NS="YOU HAVE THE "+s 1250 LET L{0B)=37 See pages 24-25 for more about how the subroutines work. Imagine your adventure is going tobe sold ina famous chain of shops and design and write an atmospheric insert for its cassette box, 1260 RETURN hb 4 1270 TF RACO27 OR (08028 AND 0BE>29) THEN GOTO 1300,“ 1280 LET HS="DRAWER OPEN* 1290 LET FCA7)=0 1300 IF RM=16 AND OB=25 THEN LET NS="IT 1S me 1510 IF RNC)24 OR OB(232 THEN BOTO 1340 aa 1320 LET MS=*CREEPY*VERB 13 VERB 14 VERB 15 16 VERB 17 VERB 18 VERB 20, VERB 19 1330 LET F(2)=0 340 RETURN 1350 IF OB¢>30 THEN GOTO 1380 1360 LET NS=*SONETHING HERE* 1370 LET F{18)=0 1380 IF OB=28 OR OB=29 THEN LET MS="THERE IS A DRAWER" 1390 IF OB=33 OR OB=5 THEN 6OSUB 1440 1400 IF RM=27 AND OB-35 THEN LET NS="SOMETHING BEYOND* 1410 IF 08°32 THEN BOSUB 1270 1420 IF RM=9 AND OB=31 THEN LET 430 RETURN 1440 IF RM=26 AND OB-33 THEN LET MS="THEY ARE DEMONIC WORKS" 1450 IF (0B=3 OR 0B=34) AND C(3)=1 AND F(34)=0 THEN LET H! THIS WORD WITH CARE - XZANFAR* 1400 IF C(5)=1 AND OB=5 THEN LET MS="AN ALIEN TONGUE” 470 RETURN 1480 LET HS="0K "+HS 1490 IF C(3)=0 OR OBC)34 THEN GOTO 1520 1500 LET MS="MAGIC OCCURS" 1510 IF RNCO29 THEN LET RM=INT(RND#34) #1 1520 IF C(3)=1 AND OB=34 AND RA=29 THEN LET F(34)=1 1530 RETURN 1540 IF C(12)=1 THEN LET Mi 1550 RETURN 1540 IF C(14)41 AND RA=L1 THEN LET M8="THIS 18 NO TIME FOR GANES* Check the two versions of Haunted House against each other to see where the programs differ. j="THATS DISGUSTING” USE Don'tforget, youcanadd extra verbs without adding extra subroutines. You could add LOOK for example and make ituse the EXAMINE subroutine. QU HAVE MADE & HOLE" 4 AND CUA: THEN LET M$="WHOOSH" 1590 IF OBCD13 OR C(13)=0 OR RMC?27 THEN BOTO 1630 1600 LET RS(RM)="WN" 1610 LET D8(RM)="STUDY WITH SECRET ROOM" 'YOU BROKE THROUGH" 630 RETURN 1640 IF RAC 1650 LET MS: 1660 LET RM: 52 OR C114)¢>1 OR OBC14 THEN SOTO 1680 ‘GOING DOWN" 4 1670 GOTO 1690 1680 LET MB="WHERE TO 7" Sse RETURN AND C(17)=1 AND C(8)=0 THEN LET NS=*IT WILL BURN YOUR HANDS" 7 AND C(17)=1 AND C(9)=0 THEN LET MS=*HHAT WITH 7* 17 OR C(17)=0 OR C(9)=0 OR CLB)=0 THEN GOTO 1750 1730 LET MS="IT CASTS A FLICKERING LIGHT* 1740 LET F(20)=1 Sirs RETURN 1760 IF F(20)=0 THEN GOTO 1790 1770 LET MS=" EXTINGUISHED* {1780 LET F(200=0 "St790 RETURN 1900 IF OB=24 AND C(16)=1 THEN LET MS: Perhaps youcan think of a better verb than “unlight” 1SSSS"2X81 LISTING 1810 TF 0B(>26 OR C(14)<>1 OR F126)=0 THEN BOTO 1840 1820 LET NS="PFFT - GOT THER* i ete nest 2:0 tage for the invisible objects, so you 1850 IF OB¢)10 OR C(100=0 OR CULL)=0 THEN GOTO 1910 donotneed totype inflagdata 1860 LET F424)=1 separately. SS] | 1870 LET MS=*SWITCHED ON* 3] | 1980 IF F(27)=0 OR F(24)=0 THEN GOTO 1910 $2) | 1890 LET Ms=*YOU VACUUMED THEM UP* 1900 LET F(27)=0 \ eel 910 RETURN 1920 IF AND {0B=27 OR OB=28) THEN GOSUB 1270 1930 IF RNCD16 OR OBC)25 OR F(25)=1 OR C{18)=0 THEN GOTO 1980 S&S] | 1940 LET F251 ae £3] | 1950 Ler Ms=*THE KEY TURNS - CLUNK* B] 1960 LET ReURK)="SEW" 1970 LET DS«RN)="HUGE OPEN DOOR" 980 RETURN When youDiMensiona string 1990 IF C(0B)=0 THEN BOTO 2030 array onthe ZX81, youneed to z tell the computer the length of the longest item you are going 2 tostore init. The computer then g 2020 LET L(OB)=RM reserves 36 (or however many) 050 RETURN spaces of this length. This = wastes memory space if you 73 2040 LET $=0 have one itern whichis much Oo 2050 FOR I=1 10 6 longer than all the others. 2060 IF C(1)=1 THEN LET S=S+1 2070 NEXT 1 | 2080 IF S=17 AND C(15)=0 AND RMC)31 THEN PRINT "YOU HAVE EVERYTHING RETURN TO PORCH FOR FINAL SCORE" 2090 IF SCO17 OR RMG)SL THEN GOTO 2120 } co] | 2100 PRINT "DOUBLE SCORE™ of] SS] | 2110 LET s=9#2 2) | 2120 print =YouR score *55 \ $1] ziso iF scie THEN 6oT0 2160 2140 PRINT “WELL DONE - YOU HAVE FINISHED" 2150 STOP 2160 PRINT “PRESS NEW LINE TO CONTINUE* 2170 INPUT 8 2180 LET HS="OK' — 190 RETURN Ce 2200 FOR I=1 10 W ) wy, ay | 2210 ter Fut 8 ej) 2220 Ler Cir Lines 2240 to 2380 reset the a 2230 NEXT I variables which have been SS) | 2240 Let rsisiy=n" changed during a game, so that| q 2250 LET RS(27)="W" youcan play anew game. 5 2260 LET R6116)="WE* 2270 LET D6(27)="STUDY, DESK AND WALL* + 2280 LET DS(16)="HALL WITH HUGE WOODEN DOOR*DATAINPUT SECTION 2290 LET MS="0K" 2300 LET Ft18)=1 2310 LET F(I7)=1 2320 LET F(27)=1 2330 LET F(2)=: 2340 LET F (26) 2350 LET F(23)=1 2360 LET LL=60 ‘7370 LET RI 2380 LET Fi 2390 FOR I=1 106 2400 PRINT 1 2410 INPUT LUI) 2420 NEXT I 2430 RETURN 2840 DIN R6(36,4) 2450 DIM DS (36,30) ‘2460 LET V=25 2470 DIM VS(V,9) 2480 LET W=36 2490 DIM O$(W, 13) 2500 DIN COW) 2510 DIM FAW) 2520 LET 618 2530 DIN L{6) 2540 PRINT *DESCRIPTIONS* 2550 FOR I=1 10 36 2560 PRINT 1 2570 INPUT DS(1) 2580 NEXT I 2590 STOP 2600 PRINT "ROUTES" 2610 FOR I=1 10 36 2620 PRINT I 2630 INPUT RS(I) 2640 NEXT I 2650 STOP 2660 PRINT *OBJECTS" 2670 FOR I=1 TOW 2680 PRINT I 2690 INPUT O$(1) 2700 NEXT 1 2710 STOP 2720 PRINT "VERBS" 2730 FOR I=1 10 ¥ 2740 PRINT 1 2750 INPUT ¥$(1) 13 SPACES The data: Load the data in this order. (Seepage 40.) DESCRIPTIONS ee ENTRANCE ‘TO KITCHEN, KITCHEN WITH GRIMY COOKER, SCULLERY, DUSTY ROOM, REAR TURRET ROOM, CLOSET WITH COAT, BACK HALLWAY, DARK ALCOVE, SMALL ROOM WITH RUBBISH, SPIRAL STAIRCASE, WIDE PASSAGE, SLIPPERY STEPS, HALLWAY TO REAR, POOL OF LIGHT, VAULTED HALL, HALL WITH HUGE WOODEN DOOR, TROPHY ROOM, CELLAR ROOM, FRONT HALL, SITTING ROOM, SECRET ROOM, STEEP MARBLE STAIRS, DINING ROOM, VAULT WITH COFFIN, FRONT LOBBY, LIBRARY OF EVIL BOOKS, STUDY WITH DESK. HOLE. IN WALL, COBWEBBY ROOM, VERY COLD CHAMBER, SPOOKY ROOM, FRONT PORCH, TOP OF FRONT TOWER, SLOPING CORRIDOR, UPPER GALLERY, BOATHOUSE. SOGGY PATH ram The commas show where you should press NEWLINE between data items. DON'T TYPE THE PAINTING, RING, MAGIC SPELLS, GOBLET, SCROLL, COINS, STATUE, CANDLESTICK, MATCHES, VACUUM, BATTERIES, SHOVEL, AXE, ROPE, BOAT, AEROSOL, CANDLE, KEY, NORTH, SOUTH, WEST, EAST, UP, DOWN, DOOR, BATS, GHOSTS, DRAWER, DESK, COAT, RUBBISH, COFFIN, BOOKS, XZANFAR, WALL, SPELLS HELP, CARRYING?, GO, N,S, W,E,U,D, GET, TAKE, OPEN, EXAMINE, READ, SAY, DIG, SWING, CLIMB, LIGHT, UNLIGHT, SPRAY, USE, UNLOCK, LEAVE, SCORE i 3 (You must type in this set of data each time yourun the program.) 30, 24, 21, 32, 5, 8, 16, 26, 2, 13, 14, 36, 18, 11,35, 3, 27,6Extra tips and hints 1. Use integer variables Onsome computers you can puta % sign after number variable names to show that you only want to put integers or whole numbers in them (numbers without anything to the right of the decimal point thatis). So variable V becomes V% and so on. You can do this on the BBC, TRS-80, Dragon, TRS-Color and Oric. Itis usefulto do this because it saves memory space and increases the speed by as much as 80%. The speed is particularly noticeable when the computer is executing long loops. 2. Think about screen presentation Ityouhave enough spare memory, you could improve the way the game looks on the screen. You could add a graphics routine for the opening title for instance and make the text flash on and off at particular points in the game, such as when the candle flickers or the ghosts appear. The text need not be printed at the edge of the screen, nor need itall be the same colour. Youcould make use of coloured borders and backgroundstoo. 3. Watch your spelling Ifyou are not quite sure how to'spell a word you want touse in the game, check it ina dictionary. Your computer doesn't know how tospell and will store whatever youtell itinits memory. This could be very frustrating for the player who is using the correct version and keeps getting error messages because the computer doesn't recognize the word. Some adventure gamesare a bit boringto play because everything happens inthe same place. Try tomake sure there are 46 interesting things all through the game. 5. Use REM statements When youare writing a program as long and complicated as an adventure, itisa very good idea to put REM statements in front of each section. Youare quite likely to get confused as to which section is whichif you don't. When you have finished the program, though, take the REMs out —they take up memory space, slow the program up and allow unscrupulous players to cheat. 6. Use helpful variable names Try toname your variables so thatiit is easy toremember what each oneis e.g. OB for objects, MK for mistakes, and so on. Ifyou have plenty of memory space and your computer will allow you, itis a good ideato use long variable names to help you remember what each variable is, e.g. instead of V use VERB. Make alist of your variables and what they are anyway, soyou don't mix them up while you are writing the program. Don't be too ambitious with your first games. A simple, well-thought-out game will be more fun to play than a confused, complicated one. Not everyone wants to playa game which goes on for days. 8.Keepit friendly When you have written your game, look at the comments to make sure they are not ambiguous or misleading. Instead of “TOO DARK’, for instance, you could say “YOU NEED ALIGHT TO GO HERE”. Remember, something that is obvious to you will not be atall obviousto a player. Make some of your comments funny too as this will help the player feel the computers really talking tohim.Answers to puzzles Detective game puzzle (page 13) Here are some suggested solutions for the problems in the detective game. Seehow they compare with the solutions you thought of. 1. You will only see the hair if you instruct computer to examine coat. You cannottake hair unless you have a clean envelope to putitin 2. Youneed a key to open the drawer, a magnifying glass to see the thread and asecond clean envelope to put itin. 3. Youneed plaster and a container of water to make a plaster cast of the footprint. 4. You need talcum powder to show up prints and sticky tape to lift print off surface to take away. 5. Youneed a portable blood analysis kit (described in game as a box containingbottles and other scientific equipment). 6. You need a handkerchief to pick up the stick and a polythene bag to carry itin. Adventure brain teasers (page 15) Remember there are no “correct” answers to these puzzles. Here are some suggested solutions. 1. Liftthe carpet and finda trap door. 2. Use the handkerchief as a mask (assuming drowsiness is caused by a gas inthe room), look inside rucksack and find a flask. Open the flask and find black coffee. Drink coffee. 3. Read scroll (which is a proclamation to free the slaves). 4. Throw the dessert (which happens to be custard pie) in the arch-villain’s face. Grab the remote control and escape. Puzzle (page 28) Here is how you can change the program to limit the number of objects that canbe carried at one time. Youneed twonew variables, here they are called CO (which stands for “carried objects") and CL (which stands for “carrying limit"). Add these to the end of line 70like this: 2. 1CO=0:CL=8 You then need to tell the computer to add one to CO in the GET routine whenthe player picks up an object and subtract one fromit in the LEAVE routine if he dropsan object. Do this by adding to the ends of lines 1010 and 1490 likethis: Now add anew line to the GET routine to check if CO equals the limitbefore proceeding with the rest of the routine. (CLneed not be 8, but it cannot be less or the player would not be able to carry allthe treasures to the finish.) Going further Once you have written an adventure, you could join the BBC Micro Adventure/Fantasy Club. This is a postal club and it provides a library of adventure and fantasy gameswritten by members for the use of other members. To find out more, writeto: BBC Micro Adventure Club, 29 Blackthorne Drive, Larkfield, Kent ME20 6NR, England. 47Index Adams, Scott, 4 Adventure, 4 adventure games, different types, 4 array error, 32 arrays, 16, 17, 18,31, 38 BASIC3, 4, 16, 18, 23, 38, 39, 40 BBC, 3, 23, 29, 31,33, 36, 46 BBC Micro Adventure Club, 47 branchto subroutines, 19, 24, 34 caps lock, use of, 38 carrying array, 17, 18 Changing the program, 28-32, ColossalCave, 4 combinations of words, 22, 23 commas, in data, 18, 37,45 CPUs, 17 Crowther and Woods, 4 2D arrays, 17 2D games, 26 3Dgames, 9, 26 data, 16, 17, 18 loops, 18 ‘out of, 32 storing the, 16,17, 18 for ZX81 game , 45 database, 5 debugging, 32 descriptions, 19, 20, 25, 28, 33 descriptions of the locations array, 16, 17, 20,31, 39 detective story adventure, 7, 11 DIM, 16, 17,32, 44 dimensioning, 16, 17 disc-based adventures, 4 Dragon, 3,29, 46 dummy subroutine, 23 error code, 32, error messages, setting up in game, 19,23, 24,25, 34 feedback, 19, 20,28, 33 first adventure game, 4 flag arrays, 17, 18, 24, 27, 32,44 flag registers, 17 Fortran, 4 “gettable” objects, 17 Go subroutine, 26, 27, 34,41 GOSUB, 19, 23, 28 GOTO, 19 graphics, 4,46 Grid, drawing a, 8,9 HELP, 13, 21 hiding places, 6 HOME, 33 IF... THEN, 38, initialization, 18, 19, 20, 30, 32, 33 input, 19, 21, 33 input analysis, 19, 22 instructions, player's, 21 integer variables, 46 interactive database, 5 INVENTORY, 13 invisible objects, 17, 18 LEFTS, 40 LET, 38, 40 listing, program, 33-37 Spectrum (Timex 2000) version, 38 ZXB1 (Timex 1000) version, 39-45 LOAD subroutine, 30, 31 locations, 6,8, 16, 17,40, 41 numbering of, 8, 12 locations array, 16, 17, 20,39 loop, 18, 20 machine code,5 magic, use of, 6 map, of adventure world, 6-7 master plan, 8, 11, 12, 14, 18, 16, 26 7X81 version, 39 memory, amount used up by game, 28 Microsoft-style BASIC, 3, 33 MIDS, 40 mistakes, correcting, 32 nomatch, 22 number arrays, 17 numbering of locations, 8 objects, 10, 12 object word array, 17, 18 object words, 40 one-way routes, 8,9 one-word commands, 21, 23, 26 ON. . .GOSUB, 24, 25, 30, 32, 33, 41 onrange error, 23 Oric, 3,29, 33, 34, 37, 46 out of data, 32 override conditions, 19, 24, 32 penalties, 30 planning, 5-15 point of the game, 6 problems for player, 10 program changing the, 28-32 structure, 19 writing the, 19-27 props, 10, 12 Quit, 31 READ. . .DATA, 18,39 REMstatements, 46 RIGHTS, 40 RND, 34,35 routes, 8,9, 16, 17, 40 one-way, 8,9 routes array, 17, 18, 20,31 nules,3 saving the game, 30,31 SCORE, 3 subroutine, 30, 36, 44 scoring, 10,30 screen presentation, 46 Sinclair (Timex) computers, 3, 18,21, 33, 38, 40 single-letter commands, 26 sketch map,6 sounds, 29 Spectrum, 3, 29, 33 version, 38 spelling, 46 Stanford University, 4 storing the data, 16, 17, 18 string arrays, 16 string data (for Spectrum), 38 string variables, 21, 22 subroutines, 19,24, 25, 26,31, 34, 42, 43 dummy, 23 themes forgames, 7 time limit, 28 Timex 1000, 3, 18, 21,33, 39-45 Timex 2000, 3, 21, 33, 38 tools, 12 treasures, 8, 10, 11 'TRS-80, 46 TRS-Color, 29, 46 two-word sentences, 3, 21 useful objects, 10, 11, 12, 13 variable names, 46 variables, 16, 20, 26, 30, 33, 38, 40,44 string, 21 verbs, 13, 17,24, 25, 34, 40, 43 verbs array, 17, 18 verb string, 16, 22 VIC 20, 29, 33, 34, 35,37 walls, checking for, 27 weapons, 12 word list, 10, 12, 16 word not found in memory, 16 word-splitter routine, 21 word string, 16,22 wniting the program, 19, 20,21, 22, 23, 24, 25, 26, 27 zero space, use of, 16 2X81, 3, 18,21, 33, version, 39-45 First published 1983 by Usborne Publishing Ld, 20 Garrick Street, London WC2E 9B], England, ‘Copryight © 1983 Usborne Publishing Allrights reserved. No par of this publication may be reproduced, stored in a retrieval system or transmitted in any formor by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the publisher. ‘The name Usborne and the device" are Trade Marks of Usborne Publishing td 48 printed inSpainby CEDAGSA. Barcelona, D8 29676-83
You might also like
#1 The Cave of Time - Choose Your Own Adventure
PDF
80% (10)
#1 The Cave of Time - Choose Your Own Adventure
66 pages
Amazing Tales Complete Kids' RPG
PDF
100% (1)
Amazing Tales Complete Kids' RPG
105 pages
Choose Your Own Adventure (Underground Kingdom) PDF
PDF
100% (5)
Choose Your Own Adventure (Underground Kingdom) PDF
114 pages
Choose Your Own Adventure 028 - Mountain Survival - Edward Packard
PDF
100% (4)
Choose Your Own Adventure 028 - Mountain Survival - Edward Packard
132 pages
Choose Your Own Star Wars Adventure 1 A New Hope
PDF
100% (4)
Choose Your Own Star Wars Adventure 1 A New Hope
67 pages
Space Vampire - Choose Your Own Adventure 71
PDF
100% (5)
Space Vampire - Choose Your Own Adventure 71
67 pages
Choose Your Own Adventure 017 - The Race Forever - R A Montgomery
PDF
No ratings yet
Choose Your Own Adventure 017 - The Race Forever - R A Montgomery
116 pages
Voyage To The Edge of The World (Usborne Puzzle Adventures)
PDF
100% (1)
Voyage To The Edge of The World (Usborne Puzzle Adventures)
27 pages
The Throne of Zeus - Choose Your Own Adventure 40
PDF
100% (5)
The Throne of Zeus - Choose Your Own Adventure 40
67 pages
Terror On The Titanic-Choose Your Own Adventure 24
PDF
100% (3)
Terror On The Titanic-Choose Your Own Adventure 24
73 pages
Secret of The Ninja-Choose Your Own Adventure 66
PDF
83% (6)
Secret of The Ninja-Choose Your Own Adventure 66
66 pages
The Minecraft Survival Quest Challenge
PDF
100% (1)
The Minecraft Survival Quest Challenge
4 pages
Escape The Room - Clue Cards
PDF
No ratings yet
Escape The Room - Clue Cards
5 pages
Write Your Own Adventure Programs B
PDF
100% (1)
Write Your Own Adventure Programs B
52 pages
Creating Adventure Games On Your Computer PDF
PDF
100% (3)
Creating Adventure Games On Your Computer PDF
210 pages
Fright Night - Choose Your Own Adventure 164
PDF
100% (4)
Fright Night - Choose Your Own Adventure 164
66 pages
Moon Quest CYOA Choose Your Own Adventure 26.SCBoy
PDF
100% (2)
Moon Quest CYOA Choose Your Own Adventure 26.SCBoy
75 pages
The Fairy Kidnap-Choose Your Own Adventure 29 PDF
PDF
100% (5)
The Fairy Kidnap-Choose Your Own Adventure 29 PDF
67 pages
Return To The Cave of Time-Choose Your Own Adventure 50 PDF
PDF
100% (4)
Return To The Cave of Time-Choose Your Own Adventure 50 PDF
65 pages
Time Machine 11 Mission To WW2 (Choose Your Own Adventure)
PDF
No ratings yet
Time Machine 11 Mission To WW2 (Choose Your Own Adventure)
74 pages
Computer Battle Games
PDF
100% (1)
Computer Battle Games
52 pages
Journey To The Year 3000 - Choose Your Own Super Adventure
PDF
100% (3)
Journey To The Year 3000 - Choose Your Own Super Adventure
90 pages
How To Create Adventure Games PDF
PDF
100% (1)
How To Create Adventure Games PDF
98 pages
The Book of Adventure Games
PDF
100% (4)
The Book of Adventure Games
362 pages
Au T 1661825857 Halloween Choose Your Own Adventure Interactive Powerpoint - Ver - 2
PDF
100% (1)
Au T 1661825857 Halloween Choose Your Own Adventure Interactive Powerpoint - Ver - 2
22 pages
Writing - CYOA Assignment
PDF
100% (1)
Writing - CYOA Assignment
5 pages
Narnia 4
PDF
No ratings yet
Narnia 4
64 pages
PT Choose Your Own Adventure
PDF
No ratings yet
PT Choose Your Own Adventure
3 pages
Island of Secrets PDF
PDF
100% (1)
Island of Secrets PDF
34 pages
Welcome To Pocket Dungeon 1.0
PDF
100% (2)
Welcome To Pocket Dungeon 1.0
8 pages
Computer Spy Games PDF
PDF
100% (2)
Computer Spy Games PDF
19 pages
The Throne of Zeus - Choose Your Own Adventure 40
PDF
100% (2)
The Throne of Zeus - Choose Your Own Adventure 40
67 pages
Escape From Tenopia 1 Tenopia Island
PDF
No ratings yet
Escape From Tenopia 1 Tenopia Island
75 pages
Commodore 64 Fun and Games Volume 2 (1984)
PDF
No ratings yet
Commodore 64 Fun and Games Volume 2 (1984)
196 pages
CYOA - #002 - Journey Under The Sea
PDF
No ratings yet
CYOA - #002 - Journey Under The Sea
68 pages
The Great Easter Bunny Adventure
PDF
100% (1)
The Great Easter Bunny Adventure
66 pages
Choose Your Own Adventure
PDF
No ratings yet
Choose Your Own Adventure
13 pages
Beyond Escape - Ed Packard - R - A - Montgomery - Packard - Ed - Montgomery - R - Choose Your Own Adventure
PDF
No ratings yet
Beyond Escape - Ed Packard - R - A - Montgomery - Packard - Ed - Montgomery - R - Choose Your Own Adventure
211 pages
(Ebook - Commodore Computers) Impossible Routines For The c64
PDF
No ratings yet
(Ebook - Commodore Computers) Impossible Routines For The c64
226 pages
Basic Edition: Jason Paul M Cartan
PDF
No ratings yet
Basic Edition: Jason Paul M Cartan
50 pages
Usborne Book of Creepy Computer Games
PDF
No ratings yet
Usborne Book of Creepy Computer Games
19 pages
Izako's Gamebook Catalog
PDF
No ratings yet
Izako's Gamebook Catalog
56 pages
Comics Activity Pack
PDF
No ratings yet
Comics Activity Pack
21 pages
Choose Your Adventure 029-The Fairy Kidnap PDF
PDF
100% (2)
Choose Your Adventure 029-The Fairy Kidnap PDF
67 pages
The Usborne Book of The Future PDF
PDF
100% (1)
The Usborne Book of The Future PDF
98 pages
Write Your Own Fantasy Games For Your Microcomputer
PDF
100% (2)
Write Your Own Fantasy Games For Your Microcomputer
52 pages
Trystn Emmerich Djayapranata - Copy-Paste Your Story From The Plan Into Google Slides
PDF
No ratings yet
Trystn Emmerich Djayapranata - Copy-Paste Your Story From The Plan Into Google Slides
21 pages
The House of Amontilado
PDF
100% (7)
The House of Amontilado
137 pages
3M Paper Games Collection (1974)
PDF
No ratings yet
3M Paper Games Collection (1974)
25 pages
Star Challenge 02 - The Android Invasion
PDF
100% (3)
Star Challenge 02 - The Android Invasion
123 pages
Doctor Who Unofficial Solitaire Game, by Simon Cogan: Classic Special - Gallifrey
PDF
No ratings yet
Doctor Who Unofficial Solitaire Game, by Simon Cogan: Classic Special - Gallifrey
10 pages
(GameBook) .Grailquest. .01. .The - Castle.of - Darkness
PDF
No ratings yet
(GameBook) .Grailquest. .01. .The - Castle.of - Darkness
97 pages
Writing BASIC Adventure Programs For The TRS-80 1982
PDF
100% (1)
Writing BASIC Adventure Programs For The TRS-80 1982
230 pages
Commodore 64 Adventures
PDF
100% (1)
Commodore 64 Adventures
220 pages
Adventures With The Atari
PDF
No ratings yet
Adventures With The Atari
372 pages
Adventure CVG Nov81
PDF
No ratings yet
Adventure CVG Nov81
2 pages
How To Write Adventure Games For The BBC Microcomputer Model B and The Acorn Electron - Peter Killworth
PDF
No ratings yet
How To Write Adventure Games For The BBC Microcomputer Model B and The Acorn Electron - Peter Killworth
111 pages
Family Computing Oct83 Lure Fantasy Adventure Games
PDF
No ratings yet
Family Computing Oct83 Lure Fantasy Adventure Games
7 pages
57 Assignment 6
PDF
No ratings yet
57 Assignment 6
21 pages
ALAN DUNLOP ARCHITECT - Sketch Book
PDF
100% (4)
ALAN DUNLOP ARCHITECT - Sketch Book
40 pages
Sputnik 1 PDF
PDF
No ratings yet
Sputnik 1 PDF
6 pages
Machine Code For Beginners
PDF
100% (1)
Machine Code For Beginners
51 pages
Practical Things To Do With A Microcomputer
PDF
No ratings yet
Practical Things To Do With A Microcomputer
51 pages
Beyond The Dust - Artists' Documents Today
PDF
No ratings yet
Beyond The Dust - Artists' Documents Today
212 pages