-
Notifications
You must be signed in to change notification settings - Fork 0
/
haunted.bas
554 lines (553 loc) · 21.1 KB
/
haunted.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
10 REM ******************************
20 REM * THE HAUNTED HOUSE *
30 REM * THIS VERSION IS FOR THE *
40 REM * "Agon Light2" *
50 REM * WRITTEN FOR MODE 8 *
60 REM * BY STEVE LOVEJOY *
70 REM ******************************
80 :
90 REM MAIN SETUP
100 PROC_VARS
105 PROC_LOAD_CHARS
110 PROC_INITSCREEN
120 PROC_TITLESPLASH
140 PROC_SHOW_CURSOR
150 GAMEOVER=FALSE
160 REPEAT
170 PROC_OFFERINSTRUCTIONS
180 :
200 PROC_MAINLOOP
210 UNTIL GAMEOVER=TRUE
220 PROC_RESTOREPREGAMESETTINGS
225 PROC_TITLESPLASH
230 END : REM END MAIN SETUP
250 :
240 DEF PROC_MAINLOOP : REM ****** MAIN LOOP ******
241 CLS
242 V=25:W=36:G=18:T=0
243 GOSUB1600
255 CLS : PROC_DRAW_HUD : REM WARNING LINE 255 IS A GOTO
259 COLOUR COLINTRED% : PROC_DRAW_HAUNTED(2,1) : PROC_DRAW_HOUSE(4,4) : REM DRAW HAUNTED HOUSE TITLE
261 COLOUR COLINTGREEN% PRINT TAB(LT%,8);"YOUR LOCATION"
262 COLOUR COLINTCYAN%
263 PRINT TAB(LT%,10);D$(RM) : REM ROOM NAME
264 COLOUR COLINTGREEN% : PRINT TAB(24,1);"SCORE"
265 PRINT TAB(RT%,1);"EXITS"
266 PRINT TAB(RT%,2);"";
267 COLOUR COLINTCYAN%
268 FOR I=1 TO LEN(R$(RM))
269 PRINT MID$(R$(RM),I,1);",";
270 NEXT I
271 COLOUR COLINTGREEN%
272 PRINT TAB(RT%,4);"ITEMS"
273 COLOUR COLINTCYAN%
274 PRINT : FOR I=1 TO G
275 IF L(I)=RM AND F(I)=0 THEN PRINT TAB(LT%,12);"YOU CAN SEE ";O$(I);" HERE";
276 NEXT I
277 COLOUR COLINTYELLOW%
278 FOR I=1 TO G : REM DISPLAY CARRIED ITEMS
279 IFC(I)=1 THEN PRINT TAB(RT%,6+(I)) O$(I)
280 NEXT I
281 S=0 : REM GET SCORE
282 FOR I=1 TO G
283 IF C(I)=1 THEN S=S+1
284 NEXT I
285 COLOUR COLINTCYAN% : PRINT TAB(26,2);"";S : REM PRINT SCORE
286 COLOUR COLINTGREEN% : PRINT TAB(LT%,14);M$:M$="WHAT"
287 COLOUR COLINTGREEN% : PRINT TAB(LT%,16);"WHAT WILL YOU DO NOW"
288 COLOUR COLINTCYAN% : PRINT TAB(LT%,18);""; : INPUTQ$
289 V$="":W$="":VB=0:OB=0
290 FOR I=1 TO LEN(Q$)
291 IF MID$(Q$,I,1)=" " AND V$="" THEN V$=LEFT$(Q$,I-1)
292 IF MID$(Q$,I+1,1)<>" " AND V$<>"" THEN W$=MID$(Q$,I+1,LEN(Q$)-1):I=LEN(Q$)
293 NEXT I
294 IF W$="" THEN V$=Q$
300 FOR I=1 TO V
310 IF V$=V$(I) THEN VB=I
320 NEXT I
330 FOR I=1 TO W
340 IF W$=O$(I) THEN OB=I
350 NEXT I
360 IF LEFT$(V$,4)="EXAM" THEN M$="NO NEED TO EXAMINE ANYTHING" ELSE IF W$>"" AND OB=0 THEN M$="THAT'S SILLY"
370 IF VB=0 THEN VB=V+1
380 IF W$="" THEN M$="I NEED TWO WORDS"
390 IF VB>V AND OB>0 THEN M$="YOU CAN'T '"+Q$+"'"
400 IF VB>V AND OB=0 THEN M$="YOU DON'T MAKE ANY SENSE"
410 IF VB<V AND OB>0 AND C(OB)=0 THEN M$="YOU DON'T HAVE '"+W$
420 IF F(26)=1 AND RM=13 AND RND(3)<>3 AND VB<>21 THEN M$="BATS ARE ATTACKING!" : GOTO255
430 IF RM=44 AND RND(2)=1 AND F(24)<>1 THEN F(27)=1
440 IF F(0)=1 THEN LL=LL-1
450 IF LL<1 THEN F(0)=0
460 ON VB GOSUB500,570,640,640,640,640,640,640,640,980,980,1030,1070,1140,1180,1220,1250,1300,1340,1380,1400,1430,1460,1490,1510,1590
470 IF LL=10 THEN M$="YOUR CANDLE IS WANING!"
480 IF LL=1 THEN M$="YOUR CANDLE IS OUT!"
485 T=T+1:IF T>200 THEN PRINT"MIDNIGHT HAS STRUCK. YOU DIED":END
490 GOTO255
500 COLOUR COLINTGREEN% : PRINT TAB(LT%,20)"WORDS I KNOW:"
505 VDU 28,2,26,38,20 : REM SET TEXT VP
510 COLOUR COLINTYELLOW% : PRINT TAB(LT%,22);"";
515 FOR I=1 TO V
520 PRINT V$(I);",";
525 NEXT I
530 VDU 26,30,23,1,0 : REM RESET VP TO WHOLE SCREEN, HOME,DISABLE CURSOR.
540 M$="":PRINT
550 GOSUB1580
560 RETURN
570 COLOUR COLINTGREEN% : PRINT TAB(LT%,20)"YOU ARE CARRYING:"
575 COLOUR COLINTYELLOW% : PRINT TAB(LT%,22);"";
580 FOR I=1 TO G : REM DISPLAY CARRIED ITEMS
595 REM IFC(I)=1 THEN PRINT TAB(RT%,6+(I)) O$(I)
600 NEXT I
605 COLOUR COLINTWHITE%
610 M$="":PRINT
620 GOSUB1580
630 RETURN
640 D=0
650 IF OB=0 THEN D=VB-3
660 IF OB=19 THEN D=1
670 IF OB=20 THEN D=2
680 IF OB=21 THEN D=3
690 IF OB=22 THEN D=4
700 IF OB=23 THEN D=5
710 IF OB=24 THEN D=6
720 IF RM=20 AND D=5 THEN D=1
730 IF RM=20 AND D=6 THEN D=3
740 IF RM=22 AND D=6 THEN D=2
750 IF RM=22 AND D=5 THEN D=3
760 IF RM=36 AND D=6 THEN D=1
770 IF RM=36 AND D=5 THEN D=2
780 IF F(14)=1 THEN M$="YOU FELL OUT OF THE TREE! YOU DIED":F(14)=0:PROCfall:RETURN
790 IF F(27)=1 AND RM=52 THEN M$="GHOSTS WILL NOT LET YOU MOVE":RETURN
800 IF RM=45 AND C(1)=1 AND F(34)=0 THEN M$="A MAGICAL BARRIER TO THE WEST":RETURN
810 IF (RM=26 AND F(0)=0) AND (D=1 OR D=4) THEN M$="YOU NEED A LIGHT":RETURN
820 IF RM=54 AND C(15) <>1 THEN M$="YOU'RE STUCK! YOU DIE SLOWLY..":RETURN
830 IF C(15)=1 AND NOT (RM=53 OR RM=54 OR RM=55 OR RM=47) THEN M$="YOU CAN'T CARRY A BOAT!":RETURN
840 IF (RM>26 AND RM<30) AND F(0)=0 THEN M$="TOO DARK TO MOVE":RETURN
850 F(35)=0:RL=LEN(R$(RM))
860 FOR I=1 TO RL
870 U$=MID$(R$(RM),I,1)
880 IF (U$="N" AND D=1 AND F(35)=0)THEN RM=RM-8:F(35)=1
890 IF (U$="S" AND D=2 AND F(35)=0)THEN RM=RM+8:F(35)=1
900 IF (U$="W" AND D=3 AND F(35)=0)THEN RM=RM-1:F(35)=1
910 IF (U$="E" AND D=4 AND F(35)=0)THEN RM=RM+1:F(35)=1
920 NEXT I
930 M$="OK"
940 IF F(35)=0 THEN M$="CAN'T GO THAT WAY!"
950 IF D<1 THEN M$="GO WHERE?"
960 IF RM=41 AND F(23)=1 THEN R$(49)="SW":M$="THE DOOR SLAMS SHUT!":PROCslam:F(23)=0
970 RETURN
980 IF OB>G THENM$="I CAN'T GET "+W$:RETURN
985 IF L(OB) <> RM THEN M$="IT ISN'T HERE"
990 IF F(OB) <>0 THEN M$="WHAT "+W$+"?"
1000 IF C(OB)=1 THEN M$="YOU ALREADY HAVE IT"
1010 IF OB>0 AND L(OB)=RM AND F(OB)=0 THEN C(OB)=1:L(OB)=65:M$="YOU HAVE THE "+W$
1020 RETURN
1030 IF RM=43 AND (OB=28 OR OB=29) THEN F(17)=0:M$="DRAWER OPEN"
1040 IF RM=28 AND OB=25 THEN M$="IT'S LOCKED"
1050 IF RM=38 AND OB=32 THEN M$="THAT'S CREEPY!":F(2)=0
1060 RETURN
1070 IF OB=30 THEN F(18)=0:M$="SOMETHING IS HERE!"
1080 IF OB=31 THEN M$="THAT'S DISGUSTING!"
1090 IF (OB=28 OR OB=29) THEN M$="THERE IS A DRAWER"
1100 IF OB=33 OR OB=5 THEN GOSUB1140
1110 IF RM=43 AND OB=35 THEN M$="THERE IS SOMETHING BEYOND.."
1120 IF OB=32 THEN GOSUB1030
1130 RETURN
1140 IF RM=42 AND OB=33 THEN M$="THEY ARE DEMONIC WORKS"
1150 IF (OB=3 OR OB=36) AND C(3)=1 AND F(34)=0 THEN M$="USE THIS MAGIC WORD 'XZANFAR'"
1160 IF C(5)=1 AND OB=5 THEN M$="THE SCRIPT IS IN AN ALIEN TONGUE"
1170 RETURN
1180 M$="OK '"+W$+"'"
1190 IF C(3)=1 AND OB=34 THEN M$="*MAGIC OCCURS*":PROCmagic:IF RM<>45 THEN RM=RND(63)
1200 IF C(3)=1 AND OB=34 AND RM=45 THEN F(34)=1
1210 RETURN
1220 IF C(12)=1 THEN M$="YOU MADE A HOLE"
1230 IF C(12)=1 AND RM=30 THEN M$="DUG THE BARS OUT":D$(RM)="HOLE IN WALL":R$(RM)="NSE"
1240 RETURN
1250 IF C(14)<>1 AND RM=7 THEN M$="THIS IS NO TIME TO PLAY GAMES"
1260 IF OB=14 AND C(14)=1 THEN M$="YOU SWUNG IT":PROCaxe
1270 IF OB=13 AND C(13)=1 THEN M$="WHOOSH!"
1280 IF OB=13 AND C(13)=1 AND RM=43 THEN R$(RM)="WN":D$(RM)="STUDY WITH SECRET ROOM":M$="YOU BROKE THE THIN WALL"
1290 RETURN
1300 IF OB=14 AND C(14)=1 THEN M$="IT ISN'T ATTACHED TO ANYTHING!"
1310 IF OB=14 AND C(14)<>1 AND RM=7 AND F(14)=0 THEN M$="YOU SEE THICK FOREST AND CLIFF SOUTH":F(14)=1:RETURN
1320 IF OB=14 AND C(14)<>1 AND RM=7 AND F(14)=1 THEN M$="GOING DOWN!":F(14)=0
1330 RETURN
1340 IF OB=17 AND C(17)=1 AND C(8)=0 THEN M$="IT WILL BURN YOUR HANDS"
1350 IF OB=17 AND C(17)=1 AND C(9)=0 THEN M$="NOTHING TO LIGHT IT WITH"
1360 IF OB=17 AND C(17)=1 AND C(9)=1 AND C(8)=1 THEN M$="IT CASTS A FLICKERING LIGHT":F(0)=1
1370 RETURN
1380 IF F(0)=1 THEN F(0)=0:M$="EXTINGUISHED"
1390 RETURN
1400 IF OB=26 AND C(16)=1 THEN M$="HISSS"
1410 IF OB=26 AND C(16)=1 AND F(26)=1 THEN F(26)=0:M$="PFFT! GOT THEM"
1420 RETURN
1430 IF OB=10 AND C(10)=1 AND C(11)=1 THEN M$="SWITCHED ON":F(24)=1
1440 IF F(27)=1 AND F(24)=1 THEN M$="WHIZZ- VACUUMED THE GHOSTS UP!":F(27)=0
1450 RETURN
1460 IF RM=43 AND (OB=27 OR OB=28) THEN GOSUB1030
1470 IF RM=28 AND OB=25 AND F(25)=0 AND C(18)=1 THEN F(25)=1:R$(RM)="SEW":D$(RM)="HUGE OPEN DOOR":M$="THE KEY TURNS!"
1480 RETURN
1490 IF C(OB)=1 THEN C(OB)=0:L(OB)=RM:M$="DONE"
1500 RETURN
1510 S=0
1520 FOR I=1 TO G
1530 IF C(I)=1 THEN S=S+1
1540 NEXT I
1550 IF S=17 AND C(15)<>1 AND RM<>57 THEN PRINT TAB(LT%)"YOU HAVE EVERYTHING"'"RETURN TO THE GATE FOR FINAL SCORE"
1560 IF S=17 AND RM=57 THEN PRINT TAB(LT%)"DOUBLE SCORE FOR REACHING HERE!":S=S*2
1570 PRINT TAB(LT%)"YOUR SCORE=";S:IF S>18 THEN PRINT TAB(LT%)"WELL DONE! YOU FINISHED THE GAME":END
1580 COLOUR COLINTGREEN% : PRINT TAB(LT%,35);""; : INPUT"PRESS ENTER TO CONTINUE";Q$
1585 : REM END GAME ??????
1590 RETURN
1600 DIMR$(63),D$(63),O$(W),V$(V)
1610 DIMC(W),L(G),F(W)
1620 DATA 46,38,35,50,13,18,28,42,10,25,26,4,2,7,47,60,43,32
1630 FOR I=1 TO G
1640 READ L(I)
1650 NEXT I PRINT : PRINT : PRINT : PRINT : PRINT : PRINT
1660 DATA HELP,CARRYING?,GO,N,S,W,E,U,D,GET,TAKE,OPEN,EXAMINE,READ,SAY
1670 DATA DIG,SWING,CLIMB,LIGHT,UNLIGHT,SPRAY,USE,UNLOCK,LEAVE,SCORE
1680 FOR I=1 TO V
1690 READ V$(I)
1700 NEXT I
1710 DATA SE,WE,WE,SWE,WE,WE,SWE,WS
1720 DATA NS,SE,WE,NW,SE,W,NE,NSW
1730 DATA NS,NS,SE,WE,NWUD,SE,WSUD,NS
1740 DATA N,NS,NSE,WE,WE,NSW,NS,NS
1750 DATA S,NSE,NSW,S,NSUD,N,N,NS
1760 DATA NE,NW,NE,W,NSE,WE,W,NS
1770 DATA SE,NSW,E,WE,NW,S,SW,NW
1780 DATA NE,NWE,WE,WE,WE,NWE,NWE,W
1790 FOR I=0 TO 63
1800 READR$(I)
1810 NEXT I
1820 DATA DARK CORNER,OVERGROWN GARDEN,LARGE WOODPILE,YARD BY RUBBISH
1825 DATA WEEDPATCH,FOREST,THICK FOREST,BLASTED TREE
1840 DATA CORNER OF HOUSE,ENTRANCE TO KITCHEN,KITCHEN & GRIMY COOKER,SCULLERY DOOR
1845 DATA ROOM WITH INCHES OF DUST,REAR TURRET ROOM,CLEARING BY HOUSE,PATH
1860 DATA SIDE OF HOUSE,BACK OF HALLWAY,DARK ALCOVE,SMALL DARK ROOM
1865 DATA BOTTOM OF SPIRAL STAIRCASE,WIDE PASSAGE,SLIPPERY STEPS,CLIFFTOP
1880 DATA NEAR CRUMBLING WALL,GLOOMY PASSAGE,POOL OF LIGHT,IMPRESSIVE VAULTED HALLWAY
1885 DATA HALL BY THICK WOODEN DOOR,TROPHY ROOM,CELLAR WITH COFFIN,CLIFF PATH
1900 DATA CUPBOARD WITH HANGING COAT,FRONT HALL,SITTING ROOM,SECRET ROOM
1905 DATA STEEP MARBLE STEPS,DINING ROOM,DEEP CELLAR WITH COFFIN,CLIFF PATH
1920 DATA CLOSET,FRONT LOBBY,LIBRARY OF EVIL BOOKS,STUDY WITH DESK & HOLE IN WALL
1925 DATA WEIRD COBWEBBY ROOM,VERY COLD CHAMBER,SPOOKY ROOM,CLIFF PATH BY MARSH
1940 DATA RUBBLE-STREWN VERANDAH,FRONT PORCH,FRONT TOWER,SLOPING CORRIDOR
1945 DATA UPPER GALLERY,MARSH BY WALL,MARSH,SOGGY PATH
1960 DATA TWISTED RAILING,THE IRON GATE,THE RAILINGS,BENEATH FRONT TOWER
1965 DATA DEBRIS & CRUMBLING FACADE,FALLEN BRICKWORK,ROTTING STONE ARCH,CRUMBLING CLIFFTOP
1980 FOR I=0 TO 63
1990 READD$(I)
2000 NEXT I
2010 DATA PAINTING,RING,MAGIC SPELLS,GOBLET,SCROLL,COINS,STATUE,CANDLSTK
2012 DATA MATCHES,VACUUM,BATTERY,SHOVEL,AXE,ROPE,BOAT,AEROSOL,CANDLE,KEY
2014 DATA NORTH,SOUTH,WEST,EAST,UP,DOWN
2016 DATA DOOR,BATS,GHOSTS,DRAWER,DESK,COAT,RUBBISH
2018 DATA COFFIN,BOOKS,XZANFAR,WALL,SPELLS
2060 FOR I=1 TO W
2070 READO$(I)
2080 NEXT I
2090 F(18)=1:F(17)=1:F(2)=1:F(26)=1:F(28)=1:F(23)=1:LL=60:RM=57:M$="OK"
2100 RETURN
2110 :
2120 REM Extra Procedures For
2130 REM Atmospheric Noises
2140 :
2150 DEFPROCfall
2160 FOR L=-15 TO 0
2170 SOUND 0,L,5,1
2180 NEXT L
2190 ENDPROC
2200 :
2210 DEFPROCslam
2220 FOR L=-15 TO -10
2230 SOUND 0,L,5,0.6
2240 NEXT L
2250 ENDPROC
2260 :
2270 DEFPROCmagic
2280 FOR I=40 TO 160 STEP 5
2290 SOUND 2,-15,I,5
2300 NEXT I
2310 ENDPROC
2320 :
2330 DEFPROCaxe
2340 FOR I=1 TO 10
2350 SOUND0,-15,5,1
2360 FOR M=1 TO 400 : NEXT M
2370 NEXT I
2380 ENDPROC
2390 :
2400 DEFPROCgeneral
2410 SOUND2,-15,100,2
2420 FOR M=1 TO 400 : NEXT M
2430 SOUND2,-15,100,2
2440 ENDPROC
2500 :
5000 ENDPROC : REM MAIN LOOP
5010 :
5360 REM ASK Y/N QUESTION. DOES THE USER SAY YES?
5370 DEF FN_DO_I_HEAR_YES
5380 LOCAL ANSWER, KEY%
5390 ANSWER = FALSE
5400 KEY% = -1
5410 REPEAT
5420 KEY%=INKEY(10000)
5430 UNTIL KEY% <> -1 AND (KEY% = ASC("Y")) OR (KEY% = ASC("y") OR KEY% = ASC("N")) OR (KEY% = ASC("n"))
5440 IF (KEY% = ASC("Y")) OR (KEY% = ASC("y")) THEN ANSWER = TRUE
5450 = ANSWER
5500 :
5505 DEF PROC_INITSCREEN : REM ***** INTSCREEN ****
5510 MODE mode%
5520 COLOUR COLINTRED%
5530 CLS
5540 CLG
5550 PROC_HIDE_CURSOR
5560 ENDPROC : REM END INIT
5570 :
5580 DEF PROC_HIDE_CURSOR : REM ******* HIDE_CURSOR *******
5590 VDU 23,1,0;0;0;0;
5600 ENDPROC
5610 :
5620 DEF PROC_SHOW_CURSOR : REM ****** SHOW_CURSOR *******
5630 VDU 23,1,1;0;0;0;
5640 ENDPROC
5650 :
7140 DEF PROC_TITLESPLASH : REM ********* TITLESPLASH *****
7150 PRINT : PRINT : COLOUR COLINTRED% : CLS
7160 :
7170 PROC_DRAW_HAUNTED(13,8) : REM ****** DRAW HAUNTED ******
7180 PROC_DRAW_HOUSE(15,11) : REM ******* DRAW HOUSE *******
7190 COLOUR COLINTGREEN%
7195 PRINT " "
7196 PRINT " "
7197 PRINT " "
7198 PRINT " "
7200 PRINT " A Text Adventure Game "
7202 PRINT " Based In A Haunted House "
7210 PRINT " Agon Light2 Version 1.0 "
7215 PRINT " By Steve Lovejoy (2023) "
7220 ANYKEY%=INKEY(2000)
7230 CLS
7240 ENDPROC : REM END TITLESPLASH
7250 :
7300 DEF PROC_OFFERINSTRUCTIONS : REM ****** OFFERINSTRUCTIONS ******
7310 COLOUR COLINTGREEN%
7320 PRINT TAB(LT%,15)" Do You Want Instructions (Y-N)";
7330 LOCAL ANSWER
7340 ANSWER = FALSE
7350 ANSWER = FN_DO_I_HEAR_YES
7360 IF ANSWER = TRUE THEN PROC_INSTRUCTIONS
7370 CLS
7380 ENDPROC : REM END OFFERINSTRUCTIONS
7390 :
7400 :
7410 DEF PROC_INSTRUCTIONS : REM ****** INSTRUCTIONS *******
7420 CLS
7430 PROC_DRAW_HAUNTED(13,1)
7440 PROC_DRAW_HOUSE(15,4)
7450 COLOUR COLINTGREEN%
7460 PRINT TAB(LT%);""
7470 PRINT TAB(LT%);"This is a text adventure game set in"
7480 PRINT TAB(LT%);"and around an old spooky haunted"
7490 PRINT TAB(LT%);"house. The object of the game is to"
7500 PRINT TAB(LT%);"move through the house and it's"
7510 PRINT TAB(LT%);"grounds and pick up all the hidden"
7520 PRINT TAB(LT%);"objects alone the way."
7525 PRINT TAB(LT%);"You will need all objects to gain"
7530 PRINT TAB(LT%);"access to all area's and rooms."
7540 PRINT TAB(LT%);"Good Luck.... You'll need it...."
7550 PRINT TAB(LT%);" "
7560 COLOUR COLINTYELLOW%
7570 PRINT TAB(LT%);"You Score By Collecting Items."
7580 PRINT TAB(LT%);"Type HELP For A List Of Commands."
7590 PRINT TAB(LT%);"N,E,S,W Are One-Key Short Cuts."
7600 PRINT TAB(LT%);"You Must Collect All Items And "
7610 PRINT TAB(LT%);"Visit All Locations To"
7620 PRINT TAB(LT%);"Complete The Game "
7630 PRINT TAB(LT%);" " : COLOUR COLINTGREEN%
7640 PRINT TAB(LT%);"(Hit Any Key To Begin The Horror)"
7645 PROC_HIDE_CURSOR
7650 REPEAT
7660 ANYKEY%=INKEY(5000)
7670 UNTIL ANYKEY% <> -1
7680 CLS
7690 ENDPROC : REM END INSTRUCTIONS
7700 :
7710 DEF PROC_LOAD_CHARS : REM ****** LOAD_CHARS ******
7720 REM ASSIGN H to CHRS.
7730 VDU 23,201,0,56,56,56,56,56,57,59
7740 VDU 23,202,0,28,28,28,28,28,252,252
7750 VDU 23,203,57,56,56,56,56,56,56,48
7760 VDU 23,204,252,60,28,28,28,28,28,12
7770 REM ASSIGN A to CHARS.
7780 VDU 23,205,0,1,1,3,3,7,7,7
7790 VDU 23,206,0,128,128,128,192,192,224,224
7800 VDU 23,207,15,14,14,30,30,28,60,56
7810 VDU 23,208,96,112,112,240,248,60,28,30
7820 REM ASSIGN U to CHARS.
7830 VDU 23,209,0,16,56,56,56,56,56,56
7840 VDU 23,210,0,8,28,28,28,28,28,28
7850 VDU 23,211,56,56,56,56,56,60,60,30
7860 VDU 23,212,28,28,28,28,28,60,60,120
7870 REM ASSIGN N to CHARS.
7880 VDU 23,213,0,24,24,28,30,62,63,63
7890 VDU 23,214,0,8,28,28,28,28,28,156
7900 VDU 23,215,63,59,57,56,56,56,56,56
7910 VDU 23,216,252,252,252,252,124,124,60,28
7920 REM ASSIGN T to CHARS.
7930 VDU 23,217,0,24,57,113,3,3,3,3
7940 VDU 23,218,0,244,248,252,192,192,192,192
7950 VDU 23,219,3,3,3,3,3,3,3,3
7960 VDU 23,220,192,192,192,192,192,192,192,192
7970 REM ASSIGN E to CHARS.
7980 VDU 23,221,0,12,30,30,30,30,30,30
7990 VDU 23,222,0,124,124,24,0,0,56,124
8000 VDU 23,223,30,30,30,30,30,30,30,30
8010 VDU 23,224,56,0,0,0,0,56,124,56
8020 REM ASSIGN D to CHARS.
8030 VDU 23,225,0,48,57,56,56,56,56,56
8040 VDU 23,226,0,192,224,240,60,28,28,28
8050 VDU 23,227,56,56,56,56,56,56,56,48
8060 VDU 23,228,28,28,28,60,252,248,240,192
8070 REM ASSIGN O to CHARS.
8080 VDU 23,229,0,2,6,15,30,60,56,120
8090 VDU 23,230,0,96,96,120,124,28,30,14
8100 VDU 23,231,120,120,120,120,56,60,30,14
8110 VDU 23,232,14,14,14,30,30,60,120,112
8120 REM ASSIGN S to CHARS.
8130 VDU 23,233,0,7,15,31,63,62,60,31
8140 VDU 23,234,0,16,188,28,30,12,0,128
8150 VDU 23,235,15,3,0,0,56,56,60,30
8160 VDU 23,236,240,248,124,60,60,120,240,224
8170 :
8190 REM HUD CHARS
8200 VDU 23,237,255,255,192,192,192,192,192,192 : REM TOP LEFT CORNER
8210 VDU 23,238,255,255,3,3,3,3,3,3 : REM TOP RIGHT CORNER
8220 VDU 23,239,192,192,192,192,192,192,255,255 : REM BOT LEFT CORNER
8230 VDU 23,240,3,3,3,3,3,3,255,255 : REM BOT RIGHT CORNER
8240 VDU 23,241,255,255,0,0,0,0,0,0 : REM TOP STRAIGHT
8250 VDU 23,242,0,0,0,0,0,0,255,255 : REM BOT STRAIGHT
8260 VDU 23,243,192,192,192,192,192,192,192,192 : REM LEFT STRAIGHT
8270 VDU 23,244,3,3,3,3,3,3,3,3 : REM RIGHT STRAIGHT
8280 :
8300 ENDPROC : REM END LOAD_CHARS
8390 :
8400 DEF PROC_VARS : REM **** VARS *****
8410 REM COLOURS
8411 COLBLACK% = 0
8412 COLRED% = 1
8413 COLGREEN% = 2
8414 COLYELLOW% = 3
8415 COLBLUE% = 4
8416 COLMAGENTA% = 5
8417 COLCYAN% = 6
8418 COLWHITE% = 7
8419 COLINTRED% = 9
8420 COLINTGREEN% = 10
8421 COLINTYELLOW% = 11
8422 COLINTBLUE% = 12
8423 COLINTMAGENTA% = 13
8424 COLINTCYAN% = 14
8425 COLINTWHITE% = 15
8450 mode% = 8 : REM SET MODE HERE
8460 RT% = 31 : REM SET RIGHT TEXT
8470 LT% = 2 : REM SET LEFT TEXT
8480 T1X = 0 : REM TITLE TEXT HAUNTED X
8490 T1Y = 0 : REM TITLE TEXT HAUNTED Y
8500 T2X = 0 : REM TITLE TEXT HOUSE X
8510 T2Y = 0 : REM TITLE TEXT HOUSE Y
8520 :
8530 :
8700 ENDPROC : REM END VARS
8800 :
8830 DEF PROC_RESTOREPREGAMESETTINGS : REM ***** RESTOREGAMESETTINGS ******
8840 REM TODO CACHE AND RESTORE MODE ONCE 1.04 RELEASED
8850 REM sysvar_scrMode :EQU27h; 1: Screen mode (from MOS 1.04)
8860 VDU 23,0,193,0 : MODE mode%
8870 PROC_SHOW_CURSOR
8880 COLOUR COLINTWHITE%
8890 GAMEOVER = FALSE
8900 CLS
8910 ENDPROC : REM END RESORE
8920 :
8930 REM HANDLE ERROR (WHICH INCLUDES ESCAPE KEY)
8940 VDU 23,1,1;0;0;0;
8950 VDU 23,0,193,0 : MODE mode%)23,12
8960 COLOUR COLINTWHITE%
8970 REPORT
8980 PRINT" at line ";ERL
8990 :
9000 DEF PROC_DRAW_HAUNTED(T1X,T1Y) : REM ****** DRAW_HAUNTED ******
9010 :
9020 REM From custom chars defined previously.
9030 : REM HAUNTED
9040 REM DISPLAY H (2x2) CHARS.
9050 COLOUR COLINTRED%
9060 PRINT TAB(T1X,T1Y);CHR$(201);CHR$(202)
9070 PRINT TAB(T1X,T1Y+1);CHR$(203);CHR$(204)
9080 REM DISPLAY A (2x2) CHARS.
9090 PRINT TAB(T1X+2,T1Y);CHR$(205);CHR$(206)
9100 PRINT TAB(T1X+2,T1Y+1);CHR$(207);CHR$(208)
9110 REM DISPLAY U (2x2) CHARS.:PRINT TAB(0,3)CHR$(243);
9120 PRINT TAB(T1X+4,T1Y);CHR$(209);CHR$(210)
9130 PRINT TAB(T1X+4,T1Y+1);CHR$(211);CHR$(212)
9140 REM DISPLAY N (2x2) CHARS.
9150 PRINT TAB(T1X+6,T1Y);CHR$(213);CHR$(214)
9160 PRINT TAB(T1X+6,T1Y+1);CHR$(215);CHR$(216)
9170 REM DISPLAY T (2x2) CHARS.
9180 PRINT TAB(T1X+8,T1Y);CHR$(217);CHR$(218)
9190 PRINT TAB(T1X+8,T1Y+1);CHR$(219);CHR$(220)
9200 REM DISPLAY E (2x2) CHARS.
9210 PRINT TAB(T1X+10,T1Y);CHR$(221);CHR$(222)
9220 PRINT TAB(T1X+10,T1Y+1);CHR$(223);CHR$(224)
9230 REM DISPLAY D (2x2) CHARS.
9240 PRINT TAB(T1X+12,T1Y);CHR$(225);CHR$(226)
9250 PRINT TAB(T1X+12,T1Y+1);CHR$(227);CHR$(228)
9260 ENDPROC : REM END DRAW_HAUNTED
9270 :
9300 DEF PROC_DRAW_HOUSE(T2X,T2Y) : REM ***** DRAW_HOUSE ******
9310 : REM HOUSE
9320 REM DISPLAY H (2x2) CHARS.
9330 COLOUR COLINTRED%
9340 PRINT TAB(T2X,T2Y);CHR$(201);CHR$(202)
9350 PRINT TAB(T2X,T2Y+1);CHR$(203);CHR$(204)
9360 REM DISPLAY O (2x2) CHARS.
9370 PRINT TAB(T2X+2,T2Y);CHR$(229);CHR$(230)
9380 PRINT TAB(T2X+2,T2Y+1);CHR$(231);CHR$(232)
9390 REM DISPLAY U (2x2) CHARS.
9400 PRINT TAB(T2X+4,T2Y);CHR$(209);CHR$(210)
9410 PRINT TAB(T2X+4,T2Y+1);CHR$(211);CHR$(212)
9420 REM DISPLAY S (2x2) CHARS.
9430 PRINT TAB(T2X+6,T2Y);CHR$(233);CHR$(234)
9440 PRINT TAB(T2X+6,T2Y+1);CHR$(235);CHR$(236)
9450 REM DISPLAY E (2x2) CHARS.
9460 PRINT TAB(T2X+8,T2Y);CHR$(221);CHR$(222)
9470 PRINT TAB(T2X+8,T2Y+1);CHR$(223);CHR$(224)
9500 ENDPROC : REM END DRAW_HOUSE
9510 :
9600 DEF PROC_DRAW_HUD : REM ***** DRAW_HUD *******
9610 COLOUR COLINTRED%
9620 PRINT TAB(0,0);CHR$(237) : REM TL CORNER
9630 FOR TB = 1 TO 38 : REM TOP BORDER
9640 PRINT TAB(TB,0)CHR$(241)
9650 NEXT TB
9660 PRINT TAB(39,0)CHR$(238) : REM TR CORNER
9670 FOR LB = 1 TO 27 : REM LEFT BORDER
9680 PRINT TAB(0,LB)CHR$(243)
9690 NEXT LB
9700 FOR RB = 1 TO 27 : REM RIGHT BORDER
9710 PRINT TAB(39,RB)CHR$(244)
9720 NEXT RB
9730 PRINT TAB(0,27);CHR$(239) : REM BL CORNER
9740 FOR BB = 1 TO 38 : REM BOTTOM BORDER
9750 PRINT TAB(BB,27)CHR$(242)
9760 NEXT BB
9770 PRINT TAB(39,27);CHR$(240) : REM BR CORNER
9780 FOR VS = 1 TO 26 : REM VERTICAL SPLIT
9790 PRINT TAB(30,VS)CHR$(243)
9800 NEXT VS
9810 PRINT TAB(20,15)"" : REM TO ELIMINATE SCREEN SCROLLING UP
10000 ENDPROC : REM END DRAW_HUD