Advertisement
lovejoy777

Haunted House

Dec 8th, 2023 (edited)
1,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ZXBasic 10.90 KB | Source Code | 0 0
  1.     10REM  HAUNTED HOUSE ADVENTURE
  2.     20REM  ***********************
  3.     25REM  BY JENNY TYLER
  4.     26REM  AND LES HOWARTH
  5.     27REM  ***********************
  6.     30REM  THIS VERSION IS FOR THE
  7.     40REM       "Agon Light2"
  8.     50REM     WRITTEN FOR MODE 0
  9.     60REM     BY STEVE LOVEJOY
  10.     65REM  ***********************
  11.     68V=25:W=36:G=18:T=0
  12.     69GOSUB1600
  13.     70MODE 0
  14.     73CLS : COLOUR 1 : GCOL 0,1 : COLOUR 128+0
  15.     74MOVE 8,1020:DRAW 1274,1020:DRAW 1274,10:DRAW 8,10:DRAW 8,1020
  16.     75MOVE 900,1020:DRAW 900,10:MOVE 8,910:DRAW 1274,910
  17.     76MOVE 900,770:DRAW 1274,770
  18.     79COLOUR 1
  19.    116PRINT TAB(22,3);"HAUNTED HOUSE";
  20.    117PRINT TAB(20,4);"-----------------";
  21.    118PRINT TAB(2,8);"YOUR CURRENT LOCATION IS:"
  22.    119COLOUR 15 : REM WHITE
  23.    120PRINT TAB(2,12);D$(RM) : REM ROOM NAME
  24.    121COLOUR 1 : REM RED
  25.    122PRINT TAB(58,2);"SCORE"
  26.    130PRINT TAB(58,8);"CURRENT EXITS"
  27.    131PRINT TAB(58,11);"";
  28.    135COLOUR 15 : REM WHITE
  29.    140FOR I=1 TO LEN(R$(RM))
  30.    150PRINT MID$(R$(RM),I,1);",";
  31.    160NEXT I
  32.    161COLOUR 1 : REM RED
  33.    162PRINT TAB(58,16);"COLLECTED ITEMS"
  34.    163COLOUR 15 : REM WHITE
  35.    170PRINT
  36.    180FOR I=1 TO G
  37.    190IF L(I)=RM AND F(I)=0 THEN PRINT TAB(2,15);"YOU CAN SEE ";O$(I);" HERE";
  38.    200NEXT I
  39.    205COLOUR 1 : REM RED
  40.    210PRINT TAB(2,17);"====================================================="
  41.    211COLOUR 15 : REM WHITE
  42.    212FOR I=1 TO G : REM DISPLAY CARRIED ITEMS
  43.    213  IFC(I)=1 THEN PRINT TAB(58,18+(I*2)) O$(I)
  44.    214NEXT I
  45.    215S=0 : REM GET SCORE
  46.    216FOR I=1 TO G
  47.    217  IF C(I)=1 THEN S=S+1
  48.    218 NEXT I
  49.    219PRINT TAB(58,4);"";S : REM PRINT SCORE
  50.    220PRINT TAB(2,20);M$:M$="WHAT"
  51.    230PRINT TAB(2,22);"WHAT WILL YOU DO NOW"
  52.    235PRINT TAB(2,24);""; : INPUTQ$
  53.    236 :
  54.    240V$="":W$="":VB=0:OB=0
  55.    250FOR I=1 TO LEN(Q$)
  56.    260IF MID$(Q$,I,1)=" " AND V$="" THEN V$=LEFT$(Q$,I-1)
  57.    270IF MID$(Q$,I+1,1)<>" " AND V$<>"" THEN W$=MID$(Q$,I+1,LEN(Q$)-1):I=LEN(Q$)
  58.    280NEXT I
  59.    290IF W$="" THEN V$=Q$
  60.    300FOR I=1 TO V
  61.    310IF V$=V$(I) THEN VB=I
  62.    320NEXT I
  63.    330FOR I=1 TO W
  64.    340IF W$=O$(I) THEN OB=I
  65.    350NEXT I
  66.    360IF LEFT$(V$,4)="EXAM" THEN M$="NO NEED TO EXAMINE ANYTHING" ELSE IF W$>"" AND OB=0 THEN M$="THAT'S SILLY"
  67.    370IF VB=0 THEN VB=V+1
  68.    380IF W$="" THEN M$="I NEED TWO WORDS"
  69.    390IF VB>V AND OB>0 THEN M$="YOU CAN'T '"+Q$+"'"
  70.    400IF VB>V AND OB=0 THEN M$="YOU DON'T MAKE ANY SENSE"
  71.    410IF VB<V AND OB>0 AND C(OB)=0 THEN M$="YOU DON'T HAVE '"+W$
  72.    420IF F(26)=1 AND RM=13 AND RND(3)<>3 AND VB<>21 THEN M$="BATS ARE ATTACKING!":GOTO73
  73.    430IF RM=44 AND RND(2)=1 AND F(24)<>1 THEN F(27)=1
  74.    440IF F(0)=1 THEN LL=LL-1
  75.    450IF LL<1 THEN F(0)=0
  76.    460ON VB GOSUB 500,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
  77.    470IF LL=10 THEN M$="YOUR CANDLE IS WANING!"
  78.    480IF LL=1 THEN M$="YOUR CANDLE IS OUT!"
  79.    485T=T+1:IF T>200 THEN PRINT"MIDNIGHT HAS STRUCK. YOU'VE BEEN TURNED INTO A BAT":END
  80.    490GOTO73
  81.    500PRINT TAB(2,26)"WORDS I KNOW:"
  82.    505PRINT TAB(2,28);"";
  83.    510FOR I=1 TO V
  84.    520  PRINT V$(I);",";
  85.    530NEXT I
  86.    540M$="":PRINT
  87.    550GOSUB1580
  88.    560RETURN
  89.    570PRINT TAB(2,26)"YOU ARE CARRYING:"
  90.    580FOR I=1 TO G
  91.    590  IFC(I)=1 THEN PRINT TAB(58,19+(I*2)) O$(I)
  92.    600NEXT I
  93.    610M$="":PRINT
  94.    620GOSUB1580
  95.    630RETURN
  96.    640D=0
  97.    650IF OB=0 THEN D=VB-3
  98.    660IF OB=19 THEN D=1
  99.    670IF OB=20 THEN D=2
  100.    680IF OB=21 THEN D=3
  101.    690IF OB=22 THEN D=4
  102.    700IF OB=23 THEN D=5
  103.    710IF OB=24 THEN D=6
  104.    720IF RM=20 AND D=5 THEN D=1
  105.    730IF RM=20 AND D=6 THEN D=3
  106.    740IF RM=22 AND D=6 THEN D=2
  107.    750IF RM=22 AND D=5 THEN D=3
  108.    760IF RM=36 AND D=6 THEN D=1
  109.    770IF RM=36 AND D=5 THEN D=2
  110.    780IF F(14)=1 THEN M$="CRASH! YOU FELL OUT OF THE TREE!":F(14)=0:PROCfall:RETURN
  111.    790IF F(27)=1 AND RM=52 THEN M$="GHOSTS WILL NOT LET YOU MOVE":RETURN
  112.    800IF RM=45 AND C(1)=1 AND F(34)=0 THEN M$="A MAGICAL BARRIER TO THE WEST":RETURN
  113.    810IF (RM=26 AND F(0)=0) AND (D=1 OR D=4) THEN M$="YOU NEED A LIGHT":RETURN
  114.    820IF RM=54 AND C(15) <>1 THEN M$="YOU'RE STUCK!":RETURN
  115.    830IF 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
  116.    840IF (RM>26 AND RM<30) AND F(0)=0 THEN M$="TOO DARK TO MOVE":RETURN
  117.    850F(35)=0:RL=LEN(R$(RM))
  118.    860FOR I=1 TO RL
  119.    870  U$=MID$(R$(RM),I,1)
  120.    880  IF (U$="N" AND D=1 AND F(35)=0)THEN RM=RM-8:F(35)=1
  121.    890  IF (U$="S" AND D=2 AND F(35)=0)THEN RM=RM+8:F(35)=1
  122.    900  IF (U$="W" AND D=3 AND F(35)=0)THEN RM=RM-1:F(35)=1
  123.    910  IF (U$="E" AND D=4 AND F(35)=0)THEN RM=RM+1:F(35)=1
  124.    920NEXT I
  125.    930M$="OK"
  126.    940IF F(35)=0 THEN M$="CAN'T GO THAT WAY!"
  127.    950IF D<1 THEN M$="GO WHERE?"
  128.    960IF RM=41 AND F(23)=1 THEN R$(49)="SW":M$="THE DOOR SLAMS SHUT!":PROCslam:F(23)=0
  129.    970RETURN
  130.    980IF OB>G THENM$="I CAN'T GET "+W$:RETURN
  131.    985IF L(OB) <> RM THEN M$="IT ISN'T HERE"
  132.    990IF F(OB) <>0 THEN M$="WHAT "+W$+"?"
  133.   1000IF C(OB)=1 THEN M$="YOU ALREADY HAVE IT"
  134.   1010IF OB>0 AND L(OB)=RM AND F(OB)=0 THEN C(OB)=1:L(OB)=65:M$="YOU HAVE THE "+W$
  135.   1020RETURN
  136.   1030IF RM=43 AND (OB=28 OR OB=29) THEN F(17)=0:M$="DRAWER OPEN"
  137.   1040IF RM=28 AND OB=25 THEN M$="IT'S LOCKED"
  138.   1050IF RM=38 AND OB=32 THEN M$="THAT'S CREEPY!":F(2)=0
  139.   1060RETURN
  140.   1070IF OB=30 THEN F(18)=0:M$="SOMETHING IS HERE!"
  141.   1080IF OB=31 THEN M$="THAT'S DISGUSTING!"
  142.   1090IF (OB=28 OR OB=29) THEN M$="THERE IS A DRAWER"
  143.   1100IF OB=33 OR OB=5 THEN GOSUB1140
  144.   1110IF RM=43 AND OB=35 THEN M$="THERE IS SOMETHING BEYOND.."
  145.   1120IF OB=32 THEN GOSUB1030
  146.   1130RETURN
  147.   1140IF RM=42 AND OB=33 THEN M$="THEY ARE DEMONIC WORKS"
  148.   1150IF (OB=3 OR OB=36) AND C(3)=1 AND F(34)=0 THEN M$="USE THIS MAGIC WORD WITH CARE 'XZANFAR'"
  149.   1160IF C(5)=1 AND OB=5 THEN M$="THE SCRIPT IS IN AN ALIEN TONGUE"
  150.   1170RETURN
  151.   1180M$="OK '"+W$+"'"
  152.   1190IF C(3)=1 AND OB=34 THEN M$="*MAGIC OCCURS*":PROCmagic:IF RM<>45 THEN RM=RND(63)
  153.   1200IF C(3)=1 AND OB=34 AND RM=45 THEN F(34)=1
  154.   1210RETURN
  155.   1220IF C(12)=1 THEN M$="YOU MADE A HOLE"
  156.   1230IF C(12)=1 AND RM=30 THEN M$="DUG THE BARS OUT":D$(RM)="HOLE IN WALL":R$(RM)="NSE"
  157.   1240RETURN
  158.   1250IF C(14)<>1 AND RM=7 THEN M$="THIS IS NO TIME TO PLAY GAMES"
  159.   1260IF OB=14 AND C(14)=1 THEN M$="YOU SWUNG IT":PROCaxe
  160.   1270IF OB=13 AND C(13)=1 THEN M$="WHOOSH!"
  161.   1280IF 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"
  162.   1290RETURN
  163.   1300IF OB=14 AND C(14)=1 THEN M$="IT ISN'T ATTACHED TO ANYTHING!"
  164.   1310IF 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
  165.   1320IF OB=14 AND C(14)<>1 AND RM=7 AND F(14)=1 THEN M$="GOING DOWN!":F(14)=0
  166.   1330RETURN
  167.   1340IF OB=17 AND C(17)=1 AND C(8)=0 THEN M$="IT WILL BURN YOUR HANDS"
  168.   1350IF OB=17 AND C(17)=1 AND C(9)=0 THEN M$="NOTHING TO LIGHT IT WITH"
  169.   1360IF OB=17 AND C(17)=1 AND C(9)=1 AND C(8)=1 THEN M$="IT CASTS A FLICKERING LIGHT":F(0)=1
  170.   1370RETURN
  171.   1380IF F(0)=1 THEN F(0)=0:M$="EXTINGUISHED"
  172.   1390RETURN
  173.   1400IF OB=26 AND C(16)=1 THEN M$="HISSS"
  174.   1410IF OB=26 AND C(16)=1 AND F(26)=1 THEN F(26)=0:M$="PFFT! GOT THEM"
  175.   1420RETURN
  176.   1430IF OB=10 AND C(10)=1 AND C(11)=1 THEN M$="SWITCHED ON":F(24)=1
  177.   1440IF F(27)=1 AND F(24)=1 THEN M$="WHIZZ- VACUUMED THE GHOSTS UP!":F(27)=0
  178.   1450RETURN
  179.   1460IF RM=43 AND (OB=27 OR OB=28) THEN GOSUB1030
  180.   1470IF 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!"
  181.   1480RETURN
  182.   1490IF C(OB)=1 THEN C(OB)=0:L(OB)=RM:M$="DONE"
  183.   1500RETURN
  184.   1510S=0
  185.   1520FOR I=1 TO G
  186.   1530  IF C(I)=1 THEN S=S+1
  187.   1540NEXT I
  188.   1550IF S=17 AND C(15)<>1 AND RM<>57 THEN PRINT"YOU HAVE EVERYTHING"'"RETURN TO THE GATE FOR FINAL SCORE"
  189.   1560IF S=17 AND RM=57 THEN PRINT"DOUBLE SCORE FOR REACHING HERE!":S=S*2
  190.   1570PRINT"YOUR SCORE=";S:IF S>18 THEN PRINT"WELL DONE! YOU FINISHED THE GAME":END
  191.   1580PRINT TAB(2,35);""; : INPUT"PRESS ENTER TO CONTINUE";Q$
  192.   1590RETURN
  193.   1600DIMR$(63),D$(63),O$(W),V$(V)
  194.   1610DIMC(W),L(G),F(W)
  195.   1620DATA 46,38,35,50,13,18,28,42,10,25,26,4,2,7,47,60,43,32
  196.   1630FOR I=1 TO G
  197.   1640  READ L(I)
  198.   1650NEXTI
  199.   1660DATA HELP,CARRYING?,GO,N,S,W,E,U,D,GET,TAKE,OPEN,EXAMINE,READ,SAY
  200.   1670DATA DIG,SWING,CLIMB,LIGHT,UNLIGHT,SPRAY,USE,UNLOCK,LEAVE,SCORE
  201.   1680FOR I=1 TO V
  202.   1690  READ V$(I)
  203.   1700NEXT I
  204.   1710DATA SE,WE,WE,SWE,WE,WE,SWE,WS
  205.   1720DATA NS,SE,WE,NW,SE,W,NE,NSW
  206.   1730DATA NS,NS,SE,WE,NWUD,SE,WSUD,NS
  207.   1740DATA N,NS,NSE,WE,WE,NSW,NS,NS
  208.   1750DATA S,NSE,NSW,S,NSUD,N,N,NS
  209.   1760DATA NE,NW,NE,W,NSE,WE,W,NS
  210.   1770DATA SE,NSW,E,WE,NW,S,SW,NW
  211.   1780DATA NE,NWE,WE,WE,WE,NWE,NWE,W
  212.   1790FOR I=0 TO 63
  213.   1800  READR$(I)
  214.   1810NEXT I
  215.   1820DATA DARK CORNER,OVERGROWN GARDEN,BY LARGE WOODPILE,YARD BY RUBBISH
  216.   1825DATA WEEDPATCH,FOREST,THICK FOREST,BLASTED TREE
  217.   1840DATA CORNER OF HOUSE,ENTRANCE TO KITCHEN,KITCHEN & GRIMY COOKER,SCULLERY DOOR
  218.   1845DATA ROOM WITH INCHES OF DUST,REAR TURRET ROOM,CLEARING BY HOUSE,PATH
  219.   1860DATA SIDE OF HOUSE,BACK OF HALLWAY,DARK ALCOVE,SMALL DARK ROOM
  220.   1865DATA BOTTOM OF SPIRAL STAIRCASE,WIDE PASSAGE,SLIPPERY STEPS,CLIFFTOP
  221.   1880DATA NEAR CRUMBLING WALL,GLOOMY PASSAGE,POOL OF LIGHT,IMPRESSIVE VAULTED HALLWAY
  222.   1885DATA HALL BY THICK WOODEN DOOR,TROPHY ROOM,CELLAR WITH COFFIN,CLIFF PATH
  223.   1900DATA CUPBOARD WITH HANGING COAT,FRONT HALL,SITTING ROOM,SECRET ROOM
  224.   1905DATA STEEP MARBLE STEPS,DINING ROOM,DEEP CELLAR WITH COFFIN,CLIFF PATH
  225.   1920DATA CLOSET,FRONT LOBBY,LIBRARY OF EVIL BOOKS,STUDY WITH DESK & HOLE IN WALL
  226.   1925DATA WEIRD COBWEBBY ROOM,VERY COLD CHAMBER,SPOOKY ROOM,CLIFF PATH BY MARSH
  227.   1940DATA RUBBLE-STREWN VERANDAH,FRONT PORCH,FRONT TOWER,SLOPING CORRIDOR
  228.   1945DATA UPPER GALLERY,MARSH BY WALL,MARSH,SOGGY PATH
  229.   1960DATA BY TWISTED RAILING,PATH THROUGH IRON GATE,BY RAILINGS,BENEATH FRONT TOWER
  230.   1965DATA DEBRIS FROM CRUMBLING FACADE,LARGE FALLEN BRICKWORK,ROTTING STONE ARCH,CRUMBLING CLIFFTOP
  231.   1980FOR I=0 TO 63
  232.   1990  READD$(I)
  233.   2000NEXT I
  234.   2010DATA PAINTING,RING,MAGIC SPELLS,GOBLET,SCROLL,COINS,STATUE,CANDLESTICK
  235.   2012DATA MATCHES,VACUUM,BATTERIES,SHOVEL,AXE,ROPE,BOAT,AEROSOL,CANDLE,KEY
  236.   2014DATA NORTH,SOUTH,WEST,EAST,UP,DOWN
  237.   2016DATA DOOR,BATS,GHOSTS,DRAWER,DESK,COAT,RUBBISH
  238.   2018DATA COFFIN,BOOKS,XZANFAR,WALL,SPELLS
  239.   2060FOR I=1 TO W
  240.   2070  READO$(I)
  241.   2080NEXT I
  242.   2090F(18)=1:F(17)=1:F(2)=1:F(26)=1:F(28)=1:F(23)=1:LL=60:RM=57:M$="OK"
  243.   2100RETURN
  244.   2110
  245.   2120REM Extra Procedures For
  246.   2130REM Atmospheric Noises
  247.   2140
  248.   2150DEFPROCfall
  249.   2160FORL=-15 TO 0
  250.   2170SOUND 0,L,5,1
  251.   2180NEXT L
  252.   2190ENDPROC
  253.   2200
  254.   2210DEFPROCslam
  255.   2220FORL=-15 TO -1
  256.   2230SOUND 0,L,5,0.6
  257.   2240NEXT L
  258.   2250ENDPROC
  259.   2260
  260.   2270DEFPROCmagic
  261.   2280FOR I=40 TO 160 STEP 5
  262.   2290SOUND 2,-15,I,5
  263.   2300NEXT I
  264.   2310ENDPROC
  265.   2320
  266.   2330DEFPROCaxe
  267.   2340FORI=1 TO 10
  268.   2350SOUND0,-15,5,1
  269.   2360FORM=1TO400:NEXTM
  270.   2370NEXTI
  271.   2380ENDPROC
  272.   2390
  273.   2400DEFPROCgeneral
  274.   2410SOUND2,-15,100,2
  275.   2420FORM=1TO400:NEXTM
  276.   2430SOUND2,-15,100,2
  277.   2440ENDPROC
  278.  
Tags: AgonLight2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement