8K Adventure ported to the ZX-81?

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
Paul Panks
Posts: 62
Joined: Sun May 25, 2008 7:23 pm

8K Adventure ported to the ZX-81?

Post by Paul Panks » Sun Jun 01, 2008 11:00 pm

I've written a short, 8K adventure game on the ZX Spectrum and would be interested in porting it to the ZX-81 if possible.

The source code to the game, as well as the corresponding .z80 snapshot, can be found here:

http://www.geocities.com/dunric/adv8k.zip

If anyone wants to convert this game for play on the ZX-81, please feel free! :)

My email is: dunric@yahoo.com

Thanks,

Paul

User avatar
BrunoFlorindo
Posts: 289
Joined: Sat May 10, 2008 2:46 am
Location: Anaheim, CA, USA

Re: 8K Adventure ported to the ZX-81?

Post by BrunoFlorindo » Mon Jun 02, 2008 4:24 am

To make it even easier for the ZX81 people, here's the ZX Spectrum listing:

Code: Select all

5 CLEAR : INK 2: POKE 23658,8: BORDER 6: PAPER 6: CLS : PRINT INVERSE 1;"DUNRIC'S 8K ADVENTURE": PRINT "WELCOME!": PRINT
  10 DIM N$(20,9): DIM O$(20,20): DIM V$(20,9): DIM D$(25,2,36): DIM M(25,6): DIM L(20): LET V$(19)="LOOK"
  11 DIM W$(2,9): LET LK=0
  15 FOR X=1 TO 25: READ D$(X,1): READ D$(X,2): NEXT X
  20 FOR X=1 TO 18: READ V$(X): NEXT X: FOR X=7 TO 20: READ N$(X): NEXT X: FOR X=7 TO 20: READ O$(X): NEXT X
  25 FOR X=1 TO 25: FOR Y=1 TO 6: READ M(X,Y): NEXT Y: NEXT X: FOR X=1 TO 20: READ L(X): NEXT X
  30 LET N$(1)="NORTH": LET N$(2)="SOUTH": LET N$(3)="EAST": LET N$(4)="WEST": LET N$(5)="UP": LET N$(6)="DOWN"
  50 LET RM=1: LET IC=0: LET LZ=0: LET HP=200: LET DM=1
  70 PRINT INVERSE 1;"ENTER YOUR NAME";: INPUT LINE M$: IF LEN (M$)>16 THEN PRINT : PRINT "TOO LONG!": GO TO 70
  71 FOR X=1 TO 200: NEXT X: CLS
  75 PRINT D$(RM,1): PRINT D$(RM,2): PRINT "EXITS:";: FOR X=1 TO 6: IF M(RM,X)>0 THEN PRINT "  ";N$(X);
  76 NEXT X: PRINT : FOR X=7 TO 20: IF L(X)=RM THEN PRINT N$(X)
  77 NEXT X
  80 PRINT INK 0;">";: INPUT LINE A$: PRINT A$: INK 2: IF L(16)=-1 THEN PRINT : PRINT INVERSE 1;"CONGRATULATIONS!": FOR X=1 TO 200: PRINT : PRINT "YOU FOUND THE SCEPTER!": STOP
  81 LET W$(1)="": LET W$(2)="": LET SI=0: LET YI=0: IF LEN (A$)=1 THEN GO TO 100
  82 FOR X=1 TO LEN (A$): IF A$(X)=" " THEN LET W$(1)=A$( TO X-1): LET SI=X+1: LET YI=1
  83 NEXT X: GO SUB 500: IF YI=1 THEN LET W$(2)=A$(SI TO X-1)
  84 IF LEN (W$(1))>20 THEN PRINT "COMMAND TOO COMPLEX": GO TO 80
  85 IF A$="HELP" THEN PRINT "GO GET DROP INVENTORY USE OPEN  EXAMINE CLIMB KILL NORTH SOUTH  EAST WEST UP DOWN QUIT EAT DRINK": GO TO 80
  86 IF A$="QUIT" THEN CLEAR : CLS : PRINT "THE END": STOP
  87 LET V=0: FOR X=1 TO 20: IF V$(X)=W$(1) THEN LET V=X
  88 NEXT X: IF V=0 THEN PRINT "VERB NOT RECOGNIZED": PRINT "TYPE "; INVERSE 1;"HELP"; INVERSE 0;" FOR CLUES": GO TO 80
  89 LET N=0: FOR X=1 TO 20: IF N$(X)=W$(2) THEN LET N=X
  90 NEXT X: IF N=0 AND V<>4 AND V<>7 AND V<>8 AND V>9 AND V<17 THEN PRINT "CAN'T DO THAT": GO TO 80
  95 GO SUB 2000: GO TO VLINE
  99 PRINT "CAN'T DO THAT": GO TO 80
 100 IF A$="N" THEN LET N=1: GO TO 110
 101 IF A$="S" THEN LET N=2: GO TO 110
 102 IF A$="E" THEN LET N=3: GO TO 110
 103 IF A$="W" THEN LET N=4: GO TO 110
 104 IF A$="U" THEN LET N=5: GO TO 110
 105 IF A$="D" THEN LET N=6: GO TO 110
 106 IF A$="I" THEN LET V=4: GO TO 160
 107 IF A$="L" THEN LET V=19: GO TO 75
 108 PRINT "WHAT?": GO TO 80
 110 IF M(RM,N)=0 THEN PRINT "CAN'T GO THAT WAY": GO TO 80
 111 IF RM=24 AND N=1 AND LK=0 THEN PRINT "CELL DOOR IS LOCKED": PRINT "I NEED A KEY!": GO TO 80
 112 IF RM=7 AND N=2 AND LZ=0 THEN PRINT "TOO DARK TO MOVE THERE": PRINT "I NEED A LANTERN!": GO TO 80
 113 IF L(18)=RM THEN IF N=2 THEN PRINT "THE GOBLIN WON'T LET YOU PASS!": GO TO 80
 114 IF L(19)=RM THEN IF N=1 THEN PRINT "THE KNIGHT BARS PASSAGE NORTH!": GO TO 80
 115 IF L(20)=RM THEN IF N=1 THEN PRINT "THE DEMON HISSES 'NO SCEPTER!'": GO TO 80
 116 LET RM=M(RM,N): GO TO 75
 130 IF L(N)=RM AND N>6 AND N<17 AND IC<6 THEN LET IC=IC+1: LET L(N)=-1: PRINT "TAKEN": GO TO 80
 131 IF IC>=5 THEN PRINT INVERSE 1;"TOO HEAVY": PRINT "DROP SOME ITEMS!": GO TO 80
 132 PRINT "CAN'T PICK THAT UP": GO TO 80
 140 IF L(N)=-1 AND N>6 AND N<17 THEN LET IC=IC-1: LET L(N)=RM: PRINT "DROPPED": GO TO 80
 141 PRINT "CAN'T DROP THAT": GO TO 80
 150 IF N=7 AND L(N)=-1 AND LZ=0 THEN IF L(8)=-1 THEN PRINT "LANTERN FLICKERS ON": LET LZ=1: GO TO 80
 151 IF N=7 AND L(N)=-1 THEN PRINT "CAN'T DO THAT": GO TO 80
 152 IF N=9 AND L(N)=-1 THEN IF RM=9 THEN PRINT "THE ROPE CATCHES ON A BRANCH": FOR X=1 TO 200: PRINT "YOU CLIMB UP...": LET RM=8: LET L(9)=9: LET O$(9)="ROPE (HANGING DOWN)": LET IC=IC-1: GO TO 75
 153 IF N=10 AND L(N)=-1 AND LK=0 THEN IF RM=24 THEN LET LK=1: PRINT "CLICK! CELL DOOR UNLOCKS": GO TO 80
 154 PRINT "CAN'T DO THAT": GO TO 80
 160 IF L(9)=-1 THEN LET O$(9)="COILED ROPE ABOUT 10 FEET"
 161 LET IC=0: FOR X=7 TO 16: IF L(X)=-1 THEN PRINT INK 4;"  ";N$(X): LET IC=IC+1
 162 NEXT X: IF IC=0 THEN PRINT "YOU ARE EMPTY HANDED": GO TO 80
 163 GO TO 80
 170 PRINT "CAN'T DO THAT": PRINT "TRY "; INVERSE 1;"USE"; INVERSE 0;" INSTEAD": GO TO 80
 180 IF N=0 THEN GO TO 182
 181 PRINT O$(N): GO TO 80
 182 IF W$(2)="FIREPLACE" AND RM=4 THEN PRINT "THE FIREPLACE IS CURRENTLY LIT": GO TO 80
 183 IF W$(2)="TABLE" THEN IF RM=8 THEN PRINT "THE TABLE HAS WORDS INSCRIBED": PRINT "WORDS READ: '"; INVERSE 1;"USE KEY TO UNLOCK CELL"; INVERSE 0;"'": GO TO 80
 184 IF W$(2)="BOOKSHELF" THEN IF RM=8 THEN PRINT "THE BOOKSHELF CONTAINS MANY OLD BOOKS": GO TO 80
 185 IF W$(2)="DRESSER" AND RM=3 THEN PRINT "IT'S AN ORDINARY DRESSER": GO TO 80
 186 IF W$(2)="BED" THEN IF RM=11 OR RM=3 THEN PRINT "THE BED LOOKS COMFORTABLE": GO TO 80
 187 IF W$(2)="TREE" THEN IF RM=9 THEN PRINT "THE TREE HAS LOW BRANCHES": GO TO 80
 188 IF W$(2)="THRONE" THEN IF RM=22 THEN PRINT "THE THRONE IS MISSING A SCEPTER": GO TO 80
 189 PRINT "YOU NOTICE NOTHING UNUSUAL": GO TO 80
 190 IF W$(2)="TREE" THEN IF RM<>9 THEN PRINT "YOU DON'T SEE A TREE LOW ENOUGH TO CLIMB": GO TO 80
 191 IF W$(2)="TREE" THEN IF L(9)<>-1 THEN PRINT "YOU NEED THE ROPE FIRST": GO TO 80
 192 IF W$(2)="TREE" THEN PRINT "YOU CLIMB UP...": LET O$(9)="ROPE (HANGING DOWN)": LET IC=IC-1: LET L(9)=9: FOR X=1 TO 200: NEXT X: LET RM=8: GO TO 75
 193 PRINT "CAN'T CLIMB THAT": GO TO 80
 200 LET MH=INT (RND*N+100)+1: IF N<17 THEN PRINT "YOU CAN'T KILL THAT": GO TO 80
 201 LET I=INT (RND*15)+1: LET DM=1: IF L(11)=-1 THEN LET DM=8: PRINT INVERSE 1;"USE DAGGER": GO TO 203
 202 PRINT INVERSE 1;"BARE HANDS"
 203 POKE 23692,255: PRINT ">": IF I<=5 THEN PRINT "YOU MISSED ";N$(N)
 204 IF I>=6 AND I<=10 THEN PRINT "YOU HIT ";N$(N): LET MH=MH-2*DM
 205 IF I>=11 AND I<=16 THEN PRINT "YOU HIT ";N$(N): PRINT "VERY HARD!": LET MH=MH-5*DM
 206 PRINT INVERSE 1;"YOUR HP"; INVERSE 0;":";HP: PRINT INVERSE 1;"THE ";N$(N); INVERSE 0;":";MH
 207 PRINT ">": FOR X=1 TO 800: NEXT X: LET AC=0: IF I=12 OR I=13 THEN IF L(12)=-1 THEN LET AC=I: LET HP=HP+I
 208 LET I=INT (RND*15)+1: IF I<=5 THEN PRINT "THE ";N$(N): PRINT "MISSED YOU"
 209 IF I>=6 AND I<=10 THEN PRINT "THE ";N$(N): PRINT "HIT YOU": LET HP=HP-2*I
 210 IF I>=11 AND I<=16 AND L(13)<>-1 THEN PRINT "THE ";N$(N): PRINT "HIT YOU VERY HARD": LET HP=HP-3*I
 211 PRINT ">": IF MH<1 OR MH<0 THEN PRINT INVERSE 1;"THE ";N$(N): PRINT "HAS DIED": LET L(N)=998: PRINT "YOU KILLED ";N$(N): FOR X=1 TO 200: NEXT X: LET HP=HP+25: GO TO 80
 212 IF HP<1 OR HP<0 THEN PRINT INVERSE 1;"ALAS, YOU HAVE DIED": FOR X=1 TO 500: NEXT X: CLEAR : CLS : PRINT "BETTER LUCK NEXT TIME...": STOP
 213 GO TO 201
 250 IF N=14 THEN IF L(N)=-1 THEN PRINT "YOU EAT SOME FOOD": FOR X=1 TO 200: NEXT X: PRINT "YOU FEEL BETTER!": LET HP=HP+10: GO TO 80
 251 PRINT "CAN'T EAT THAT": GO TO 80
 260 IF N=15 THEN IF L(N)=-1 THEN PRINT "YOU DRINK THE WATER": FOR X=1 TO 200: NEXT X: PRINT "YOU FEEL REFRESHED": LET HP=HP+25: LET L(N)=5: LET IC=IC-1: GO TO 80
 261 PRINT "CAN'T DRINK THAT HERE": GO TO 80
 270 GO TO 75
 300 CLEAR : CLS : PRINT INVERSE 1;"THANKS FOR PLAYING!": STOP
 350 REM open15,8,15,"s0:"+na$+",s,w":close15
 351 REM open2,8,2,"0:"+na$+",s,w":print#2,na$:print#2,rm:print#2,lz:print#2,lk:print#2,hp:print#2,ic:forx=7to20:print#2,lo(x):next:close2:print"done!":print:goto80
 500 IF YI=0 THEN LET W$(1)=A$
 501 RETURN
1001 DATA "YOU ARE IN THE TAVERN","A STAIRCASE IS VISIBLE HERE"
1002 DATA "YOU ARE UPSTAIRS IN THE TAVERN","A SMALL ROOM LIES TO THE EAST"
1003 DATA "YOU ARE IN A SMALL ROOM","A DRESSER IS HERE, BESIDE A BED"
1004 DATA "YOU ARE INSIDE THE HOUSE","A FIREPLACE BURNS SOFTLY NEARBY"
1005 DATA "YOU ARE AT THE VILLAGE WELL","WATER RISES FROM DEPTHS BELOW"
1006 DATA "YOU ARE ON A PATH","A VILLAGE STANDS TO THE NORTH"
1007 DATA "YOU ARE IN A CLEARING","A FOREST GROWS TO THE SOUTH"
1008 DATA "YOU ARE INSIDE A HUT","A TABLE IS HERE, BESIDE A BOOKSHELF"
1009 DATA "YOU ARE FACING AN OAK TREE","IT IS TWISTED BY AGE AND TIME"
1010 DATA "YOU ARE IN THE WESTERN WOODS","A COTTAGE IS WEST"
1011 DATA "YOU ARE INSIDE THE COTTAGE","A BED IS HERE, WHERE YOU CAN REST"
1012 DATA "YOU ARE IN THE MIDDLE FOREST","A LAKE IS THE TO EAST"
1013 DATA "YOU ARE BESIDE THE LAKE","A PATH HEADS WEST INTO THE FOREST"
1014 DATA "YOU ARE AT A LARGE HILL","IT BENDS SOUTH PAST A SMALL FARM"
1015 DATA "YOU ARE AT THE FOREST EDGE","THE GROWTH IS LESS DENSE HERE"
1016 DATA "YOU ARE BY THE CASTLE","A MOAT STANDS TO THE WEST"
1017 DATA "YOU ARE NEAR THE CASTLE MOAT","THE DRAWBRIDGE IS DOWN (FOR NOW)"
1018 DATA "YOU ARE IN THE MAIN HALL","DOORS LINE EITHER SIDE OF THE HALLWAY"
1019 DATA "YOU ARE IN GUEST QUARTERS","IT IS MOSTLY BARE SAVE FOR A BED"
1020 DATA "YOU ARE IN THE GUILD","SOME TABLES ARE BESIDE A FIREPLACE HERE"
1021 DATA "YOU ARE IN THE PARLOR","A LIBRARY IS WEST AND THE THRONE NORTH"
1022 DATA "YOU ARE AT THE THRONE","A SCEPTER IS MISSING FROM ONE SIDE"
1023 DATA "YOU ARE IN THE LIBRARY","ROWS OF BOOKS LINE TALL SHELVES HERE"
1024 DATA "YOU ARE IN THE DUNGEON","IT IS QUITE DARK IN HERE"
1025 DATA "YOU ARE INSIDE A CELL","ON A TABLE RESTS SOME ITEMS"
1101 DATA "GO","GET","DROP","INVENTORY","USE","OPEN","EXAMINE","CLIMB","KILL","NORTH","SOUTH","EAST","WEST","UP","DOWN","QUIT","EAT","DRINK"
1207 DATA "LANTERN","OIL","ROPE","KEY"
1211 DATA "DAGGER","CHAINMAIL","ROBE"
1214 DATA "FOOD","WATER","SCEPTER"
1217 DATA "VILLAGER","GOBLIN","KNIGHT"
1220 DATA "DEMON"
1227 DATA "A BRASS LANTERN","A FLASK OF OIL","COILED ROPE ABOUT 10 FEET","A SMALL KEY","A FINE DAGGER","A SUIT OF CHAINMAIL","AN ELVEN ROBE","SOME FOOD RATIONS"
1228 DATA "THIS WATER MAKES YOU THIRSTY","THE JEWELED SCEPTER!","A COMMON VILLAGER","A MENACING GOBLIN","A POWERFUL KNIGHT","A HIDEOUS DEMON"
1301 DATA 0,0,0,5,2,0
1302 DATA 0,0,3,0,0,1
1303 DATA 0,0,0,2,0,0
1304 DATA 0,5,0,0,0,0
1305 DATA 4,6,1,0,0,0
1306 DATA 5,7,0,0,0,0
1307 DATA 6,10,0,0,0,0
1308 DATA 0,0,0,0,0,9
1309 DATA 0,12,0,0,0,0
1310 DATA 7,15,12,11,0,0
1311 DATA 0,0,10,0,0,0
1312 DATA 9,14,13,10,0,0
1313 DATA 0,0,0,12,0,0
1314 DATA 12,0,0,0,0,0
1315 DATA 10,0,0,16,0,0
1316 DATA 0,0,15,17,0,0
1317 DATA 18,0,16,0,0,0
1318 DATA 21,17,19,20,0,0
1319 DATA 0,0,0,18,0,0
1320 DATA 0,0,18,0,0,0
1321 DATA 22,18,0,23,0,0
1322 DATA 0,21,0,0,0,0
1323 DATA 0,0,21,0,0,24
1324 DATA 25,0,0,0,23,0
1325 DATA 0,24,0,0,0,0
1401 DATA 89,89,89,89,89,89
1407 DATA 3,3,11,4,11,20,8,1,5
1416 DATA 25,5,10,17,24
1500 STOP
2000 IF V=1 THEN LET VLINE=110
2001 IF V=2 THEN LET VLINE=130
2002 IF V=3 THEN LET VLINE=140
2003 IF V=4 THEN LET VLINE=160
2004 IF V=5 THEN LET VLINE=150
2005 IF V=6 THEN LET VLINE=170
2006 IF V=7 THEN LET VLINE=180
2007 IF V=8 THEN LET VLINE=190
2008 IF V=9 THEN LET VLINE=200
2009 IF V=10 THEN LET VLINE=110
2010 IF V=11 THEN LET VLINE=110
2011 IF V=12 THEN LET VLINE=110
2012 IF V=13 THEN LET VLINE=110
2013 IF V=14 THEN LET VLINE=110
2014 IF V=15 THEN LET VLINE=110
2015 IF V=16 THEN LET VLINE=300
2016 IF V=17 THEN LET VLINE=250
2017 IF V=18 THEN LET VLINE=260
2018 IF V=19 THEN LET VLINE=270
2019 IF V=20 THEN LET VLINE=350
2020 RETURN
9999 SAVE "8K ADV": PRINT "DONE!": STOP
I wish Andrew could see this thread. I'm pretty sure he's a master of ZX81 Basic.

Paul Panks
Posts: 62
Joined: Sun May 25, 2008 7:23 pm

Re: 8K Adventure ported to the ZX-81?

Post by Paul Panks » Wed Jun 04, 2008 9:07 pm

Is Andrew a regular poster?

Paul

User avatar
gus
Posts: 177
Joined: Fri May 16, 2008 10:18 pm
Location: Buenos Aires. Argentina
Contact:

Re: 8K Adventure ported to the ZX-81?

Post by gus » Fri Jun 06, 2008 4:59 pm

HI,
Well I like to do the conversion, if no one started yet... I will start working (playing) right now so if you already doing it feel free to stop me :)
Gus

Paul Panks
Posts: 62
Joined: Sun May 25, 2008 7:23 pm

Re: 8K Adventure ported to the ZX-81?

Post by Paul Panks » Fri Jun 06, 2008 11:26 pm

Thanks Gus. Let us know how it goes.

Paul

Paul Panks
Posts: 62
Joined: Sun May 25, 2008 7:23 pm

Re: 8K Adventure ported to the ZX-81?

Post by Paul Panks » Sat Jun 07, 2008 3:06 am

Here's an even more up-to-date version, with bug fixes:

Code: Select all

   5 CLEAR : INK 2: POKE 23658,8: BORDER 6: PAPER 6: CLS : PRINT INVERSE 1;"DUNRIC'S 8K ADVENTURE": PRINT "WELCOME!": PRINT
  10 DIM N$(20,9): DIM O$(20,20): DIM V$(25,9): DIM D$(25,2,36): DIM M(25,6): DIM L(25): LET V$(19)="LOOK"
  11 DIM W$(2,9): LET LK=0
  15 FOR X=1 TO 25: READ D$(X,1): READ D$(X,2): NEXT X
  20 FOR X=1 TO 18: READ V$(X): NEXT X: FOR X=7 TO 20: READ N$(X): NEXT X: FOR X=7 TO 20: READ O$(X): NEXT X
  25 FOR X=1 TO 25: FOR Y=1 TO 6: READ M(X,Y): NEXT Y: NEXT X: FOR X=1 TO 20: READ L(X): NEXT X
  30 LET N$(1)="NORTH": LET N$(2)="SOUTH": LET N$(3)="EAST": LET N$(4)="WEST": LET N$(5)="UP": LET N$(6)="DOWN"
  50 LET RM=1: LET IC=0: LET LZ=0: LET HP=200: LET DM=1
  70 PRINT INVERSE 1;"ENTER YOUR NAME";: INPUT LINE M$: IF LEN (M$)>16 THEN PRINT : PRINT "TOO LONG!": GO TO 70
  71 FOR X=1 TO 200: NEXT X: CLS
  75 PRINT D$(RM,1): PRINT D$(RM,2): PRINT "EXITS:";: FOR X=1 TO 6: IF M(RM,X)>0 THEN PRINT N$(X);
  76 NEXT X: PRINT: FOR X=7 TO 20: IF L(X)=RM THEN PRINT N$(X)
  77 NEXT X
  80 PRINT INK 0;">";: INPUT LINE A$: PRINT A$: INK 2: IF L(16)=-1 THEN PRINT : PRINT INVERSE 1;"CONGRATULATIONS!": FOR X=1 TO 200: PRINT : PRINT "YOU FOUND THE SCEPTER!": STOP
  81 LET W$(1)="": LET W$(2)="": LET SI=0: LET YI=0: IF LEN (A$)=1 THEN GO TO 100
  82 FOR X=1 TO LEN (A$): IF A$(X)=" " THEN LET W$(1)=A$( TO X-1): LET SI=X+1: LET YI=1
  83 NEXT X: GO SUB 500: IF YI=1 THEN LET W$(2)=A$(SI TO X-1)
  84 IF LEN (W$(1))>20 THEN PRINT "COMMAND TOO COMPLEX": GO TO 80
  85 IF A$="HELP" THEN PRINT "GO GET DROP INVENTORY USE OPEN  EXAMINE CLIMB KILL NORTH SOUTH  EAST WEST UP DOWN QUIT EAT DRINK": GO TO 80
  86 IF A$="QUIT" THEN CLEAR : CLS : PRINT "THE END": STOP
  87 LET V=0: FOR X=1 TO 20: IF V$(X)=W$(1) THEN LET V=X
  88 NEXT X: IF V=0 THEN PRINT "VERB NOT RECOGNIZED": PRINT "TYPE "; INVERSE 1;"HELP"; INVERSE 0;" FOR CLUES": GO TO 80
  89 LET N=0: FOR X=1 TO 20: IF N$(X)=W$(2) THEN LET N=X
  90 NEXT X: IF N=0 AND V<>4 AND V<>7 AND V<>8 AND V>9 AND V<17 OR N>20 THEN PRINT "CAN'T DO THAT": GO TO 80
  91 IF N=0 AND v<>7 THEN PRINT"HOW?":GO TO 80
  95 GO SUB 2000: GO TO VLINE
  99 PRINT "CAN'T DO THAT": GO TO 80
 100 IF A$="N" THEN LET N=1: GO TO 110
 101 IF A$="S" THEN LET N=2: GO TO 110
 102 IF A$="E" THEN LET N=3: GO TO 110
 103 IF A$="W" THEN LET N=4: GO TO 110
 104 IF A$="U" THEN LET N=5: GO TO 110
 105 IF A$="D" THEN LET N=6: GO TO 110
 106 IF A$="I" THEN LET V=4: GO TO 160
 107 IF A$="L" THEN LET V=19: GO TO 75
 108 PRINT "WHAT?": GO TO 80
 110 IF M(RM,N)=0 THEN PRINT "CAN'T GO THAT WAY": GO TO 80
 111 IF RM=24 AND N=1 AND LK=0 THEN PRINT "CELL DOOR IS LOCKED": PRINT "I NEED A KEY!": GO TO 80
 112 IF RM=7 AND N=2 AND LZ=0 THEN PRINT "TOO DARK TO MOVE THERE": PRINT "I NEED A LANTERN!": GO TO 80
 113 IF L(18)=RM THEN IF N=2 THEN PRINT "THE GOBLIN WON'T LET YOU PASS!": GO TO 80
 114 IF L(19)=RM THEN IF N=1 THEN PRINT "THE KNIGHT BARS PASSAGE NORTH!": GO TO 80
 115 IF L(20)=RM THEN IF N=1 THEN PRINT "THE DEMON HISSES 'NO SCEPTER!'": GO TO 80
 116 LET RM=M(RM,N): GO TO 75
 130 IF L(N)=RM AND N>6 AND N<17 AND IC<6 THEN LET IC=IC+1: LET L(N)=-1: PRINT "TAKEN": GO TO 80
 131 IF IC>=5 THEN PRINT INVERSE 1;"TOO HEAVY": PRINT "DROP SOME ITEMS!": GO TO 80
 132 PRINT "CAN'T PICK THAT UP": GO TO 80
 140 IF L(N)=-1 AND N>6 AND N<17 THEN LET IC=IC-1: LET L(N)=RM: PRINT "DROPPED": GO TO 80
 141 PRINT "CAN'T DROP THAT": GO TO 80
 150 IF N=7 AND L(N)=-1 AND LZ=0 THEN IF L(8)=-1 THEN PRINT "LANTERN FLICKERS ON": LET LZ=1: GO TO 80
 151 IF N=7 AND L(N)=-1 THEN PRINT "CAN'T DO THAT": GO TO 80
 152 IF N=9 AND L(N)=-1 THEN IF RM=9 THEN PRINT "THE ROPE CATCHES ON A BRANCH": FOR X=1 TO 200: PRINT "YOU CLIMB UP...": LET RM=8: LET L(9)=9: LET O$(9)="ROPE (HANGING DOWN)": LET IC=IC-1: GO TO 75
 153 IF N=10 AND L(N)=-1 AND LK=0 THEN IF RM=24 THEN LET LK=1: PRINT "CLICK! CELL DOOR UNLOCKS": GO TO 80
 154 PRINT "CAN'T DO THAT": GO TO 80
 160 IF L(9)=-1 THEN LET O$(9)="COILED ROPE ABOUT 10 FEET"
 161 LET IC=0: FOR X=7 TO 16: IF L(X)=-1 THEN PRINT INK 4;"  ";N$(X): LET IC=IC+1
 162 NEXT X: IF IC=0 THEN PRINT "YOU ARE EMPTY HANDED": GO TO 80
 163 GO TO 80
 170 PRINT "CAN'T DO THAT": PRINT "TRY "; INVERSE 1;"USE"; INVERSE 0;" INSTEAD": GO TO 80
 180 IF N=0 THEN GO TO 182
 181 PRINT O$(N): GO TO 80
 182 IF W$(2)="FIREPLACE" AND RM=4 THEN PRINT "THE FIREPLACE IS CURRENTLY LIT": GO TO 80
 183 IF W$(2)="TABLE" THEN IF RM=8 THEN PRINT "THE TABLE HAS WORDS INSCRIBED": PRINT "WORDS READ: '"; INVERSE 1;"USE KEY TO UNLOCK CELL"; INVERSE 0;"'": GO TO 80
 184 IF W$(2)="BOOKSHELF" THEN IF RM=8 THEN PRINT "THE BOOKSHELF CONTAINS MANY OLD BOOKS": GO TO 80
 185 IF W$(2)="DRESSER" AND RM=3 THEN PRINT "IT'S AN ORDINARY DRESSER": GO TO 80
 186 IF W$(2)="BED" THEN IF RM=11 OR RM=3 THEN PRINT "THE BED LOOKS COMFORTABLE": GO TO 80
 187 IF W$(2)="TREE" THEN IF RM=9 THEN PRINT "THE TREE HAS LOW BRANCHES": GO TO 80
 188 IF W$(2)="THRONE" THEN IF RM=22 THEN PRINT "THE THRONE IS MISSING A SCEPTER": GO TO 80
 189 PRINT "YOU NOTICE NOTHING UNUSUAL": GO TO 80
 190 IF W$(2)="TREE" THEN IF RM<>9 THEN PRINT "YOU DON'T SEE A TREE LOW ENOUGH TO CLIMB": GO TO 80
 191 IF W$(2)="TREE" THEN IF L(9)<>-1 THEN PRINT "YOU NEED THE ROPE FIRST": GO TO 80
 192 IF W$(2)="TREE" THEN PRINT "YOU CLIMB UP...": LET O$(9)="ROPE (HANGING DOWN)": LET IC=IC-1: LET L(9)=9: FOR X=1 TO 200: NEXT X: LET RM=8: GO TO 75
 193 PRINT "CAN'T CLIMB THAT": GO TO 80
 200 LET MH=INT (RND*N+100)+1: IF N<17 THEN PRINT "YOU CAN'T KILL THAT": GO TO 80
 201 LET I=INT (RND*15)+1: LET DM=1: IF L(11)=-1 THEN LET DM=8: PRINT INVERSE 1;"USE DAGGER": GO TO 203
 202 PRINT INVERSE 1;"BARE HANDS"
 203 POKE 23692,255: PRINT ">": IF I<=5 THEN PRINT "YOU MISSED ";N$(N)
 204 IF I>=6 AND I<=10 THEN PRINT "YOU HIT ";N$(N): LET MH=MH-2*DM
 205 IF I>=11 AND I<=16 THEN PRINT "YOU HIT ";N$(N): PRINT "VERY HARD!": LET MH=MH-5*DM
 206 PRINT INVERSE 1;"YOUR HP"; INVERSE 0;":";HP: PRINT INVERSE 1;"THE ";N$(N); INVERSE 0;":";MH
 207 PRINT ">": FOR X=1 TO 800: NEXT X: LET AC=0: IF I=12 OR I=13 THEN IF L(12)=-1 THEN LET AC=I: LET HP=HP+I
 208 LET I=INT (RND*15)+1: IF I<=5 THEN PRINT "THE ";N$(N): PRINT "MISSED YOU"
 209 IF I>=6 AND I<=10 THEN PRINT "THE ";N$(N): PRINT "HIT YOU": LET HP=HP-2*I
 210 IF I>=11 AND I<=16 AND L(13)<>-1 THEN PRINT "THE ";N$(N): PRINT "HIT YOU VERY HARD": LET HP=HP-3*I
 211 PRINT ">": IF MH<1 OR MH<0 THEN PRINT INVERSE 1;"THE ";N$(N): PRINT "HAS DIED": LET L(N)=998: PRINT "YOU KILLED ";N$(N): FOR X=1 TO 200: NEXT X: LET HP=HP+25: GO TO 80
 212 IF HP<1 OR HP<0 THEN PRINT INVERSE 1;"ALAS, YOU HAVE DIED": FOR X=1 TO 500: NEXT X: CLEAR : CLS : PRINT "BETTER LUCK NEXT TIME...": STOP
 213 GO TO 201
 250 IF N=14 THEN IF L(N)=-1 THEN PRINT "YOU EAT SOME FOOD": FOR X=1 TO 200: NEXT X: PRINT "YOU FEEL BETTER!": LET HP=HP+10: GO TO 80
 251 PRINT "CAN'T EAT THAT": GO TO 80
 260 IF N=15 THEN IF L(N)=-1 THEN PRINT "YOU DRINK THE WATER": FOR X=1 TO 200: NEXT X: PRINT "YOU FEEL REFRESHED": LET HP=HP+25: LET L(N)=5: LET IC=IC-1: GO TO 80
 261 PRINT "CAN'T DRINK THAT HERE": GO TO 80
 270 GO TO 75
 300 CLEAR : CLS : PRINT INVERSE 1;"THANKS FOR PLAYING!": STOP
 350 REM open15,8,15,"s0:"+na$+",s,w":close15
 351 REM open2,8,2,"0:"+na$+",s,w":print#2,na$:print#2,rm:print#2,lz:print#2,lk:print#2,hp:print#2,ic:forx=7to20:print#2,lo(x):next:close2:print"done!":print:goto80
 500 IF YI=0 THEN LET W$(1)=A$
 501 RETURN
1001 DATA "YOU ARE IN THE TAVERN","A STAIRCASE IS VISIBLE HERE"
1002 DATA "YOU ARE UPSTAIRS IN THE TAVERN","A SMALL ROOM LIES TO THE EAST"
1003 DATA "YOU ARE IN A SMALL ROOM","A DRESSER IS HERE, BESIDE A BED"
1004 DATA "YOU ARE INSIDE THE HOUSE","A FIREPLACE BURNS SOFTLY NEARBY"
1005 DATA "YOU ARE AT THE VILLAGE WELL","WATER RISES FROM DEPTHS BELOW"
1006 DATA "YOU ARE ON A PATH","A VILLAGE STANDS TO THE NORTH"
1007 DATA "YOU ARE IN A CLEARING","A FOREST GROWS TO THE SOUTH"
1008 DATA "YOU ARE INSIDE A HUT","A TABLE IS HERE, BESIDE A BOOKSHELF"
1009 DATA "YOU ARE FACING AN OAK TREE","IT IS TWISTED BY AGE AND TIME"
1010 DATA "YOU ARE IN THE WESTERN WOODS","A COTTAGE IS WEST"
1011 DATA "YOU ARE INSIDE THE COTTAGE","A BED IS HERE, WHERE YOU CAN REST"
1012 DATA "YOU ARE IN THE MIDDLE FOREST","A LAKE IS THE TO EAST"
1013 DATA "YOU ARE BESIDE THE LAKE","A PATH HEADS WEST INTO THE FOREST"
1014 DATA "YOU ARE AT A LARGE HILL","IT BENDS SOUTH PAST A SMALL FARM"
1015 DATA "YOU ARE AT THE FOREST EDGE","THE GROWTH IS LESS DENSE HERE"
1016 DATA "YOU ARE BY THE CASTLE","A MOAT STANDS TO THE WEST"
1017 DATA "YOU ARE NEAR THE CASTLE MOAT","THE DRAWBRIDGE IS DOWN (FOR NOW)"
1018 DATA "YOU ARE IN THE MAIN HALL","DOORS LINE EITHER SIDE OF THE HALLWAY"
1019 DATA "YOU ARE IN GUEST QUARTERS","IT IS MOSTLY BARE SAVE FOR A BED"
1020 DATA "YOU ARE IN THE GUILD","SOME TABLES ARE BESIDE A FIREPLACE HERE"
1021 DATA "YOU ARE IN THE PARLOR","A LIBRARY IS WEST AND THE THRONE NORTH"
1022 DATA "YOU ARE AT THE THRONE","A SCEPTER IS MISSING FROM ONE SIDE"
1023 DATA "YOU ARE IN THE LIBRARY","ROWS OF BOOKS LINE TALL SHELVES HERE"
1024 DATA "YOU ARE IN THE DUNGEON","IT IS QUITE DARK IN HERE"
1025 DATA "YOU ARE INSIDE A CELL","ON A TABLE RESTS SOME ITEMS"
1101 DATA "GO","GET","DROP","INVENTORY","USE","OPEN","EXAMINE","CLIMB","KILL","NORTH","SOUTH","EAST","WEST","UP","DOWN","QUIT","EAT","DRINK"
1207 DATA "LANTERN","OIL","ROPE","KEY"
1211 DATA "DAGGER","CHAINMAIL","ROBE"
1214 DATA "FOOD","WATER","SCEPTER"
1217 DATA "VILLAGER","GOBLIN","KNIGHT"
1220 DATA "DEMON"
1227 DATA "A BRASS LANTERN","A FLASK OF OIL","COILED ROPE ABOUT 10 FEET","A SMALL KEY","A FINE DAGGER","A SUIT OF CHAINMAIL","AN ELVEN ROBE","SOME FOOD RATIONS"
1228 DATA "THIS WATER MAKES YOU THIRSTY","THE JEWELED SCEPTER!","A COMMON VILLAGER","A MENACING GOBLIN","A POWERFUL KNIGHT","A HIDEOUS DEMON"
1301 DATA 0,0,0,5,2,0
1302 DATA 0,0,3,0,0,1
1303 DATA 0,0,0,2,0,0
1304 DATA 0,5,0,0,0,0
1305 DATA 4,6,1,0,0,0
1306 DATA 5,7,0,0,0,0
1307 DATA 6,10,0,0,0,0
1308 DATA 0,0,0,0,0,9
1309 DATA 0,12,0,0,0,0
1310 DATA 7,15,12,11,0,0
1311 DATA 0,0,10,0,0,0
1312 DATA 9,14,13,10,0,0
1313 DATA 0,0,0,12,0,0
1314 DATA 12,0,0,0,0,0
1315 DATA 10,0,0,16,0,0
1316 DATA 0,0,15,17,0,0
1317 DATA 18,0,16,0,0,0
1318 DATA 21,17,19,20,0,0
1319 DATA 0,0,0,18,0,0
1320 DATA 0,0,18,0,0,0
1321 DATA 22,18,0,23,0,0
1322 DATA 0,21,0,0,0,0
1323 DATA 0,0,21,0,0,24
1324 DATA 25,0,0,0,23,0
1325 DATA 0,24,0,0,0,0
1401 DATA 89,89,89,89,89,89
1407 DATA 3,3,11,4,11,20,8,1,5
1416 DATA 25,5,10,17,24
1500 STOP
2000 IF V=1 THEN LET VLINE=110
2001 IF V=2 THEN LET VLINE=130
2002 IF V=3 THEN LET VLINE=140
2003 IF V=4 THEN LET VLINE=160
2004 IF V=5 THEN LET VLINE=150
2005 IF V=6 THEN LET VLINE=170
2006 IF V=7 THEN LET VLINE=180
2007 IF V=8 THEN LET VLINE=190
2008 IF V=9 THEN LET VLINE=200
2009 IF V=10 THEN LET VLINE=110
2010 IF V=11 THEN LET VLINE=110
2011 IF V=12 THEN LET VLINE=110
2012 IF V=13 THEN LET VLINE=110
2013 IF V=14 THEN LET VLINE=110
2014 IF V=15 THEN LET VLINE=110
2015 IF V=16 THEN LET VLINE=300
2016 IF V=17 THEN LET VLINE=250
2017 IF V=18 THEN LET VLINE=260
2018 IF V=19 THEN LET VLINE=270
2019 IF V=20 THEN LET VLINE=350
2020 RETURN
9999 SAVE "8K ADV": PRINT "DONE!": STOP

User avatar
gus
Posts: 177
Joined: Fri May 16, 2008 10:18 pm
Location: Buenos Aires. Argentina
Contact:

Re: 8K Adventure ported to the ZX-81?

Post by gus » Sat Jun 07, 2008 3:38 am

Hi Paul,

I have some advances :) tomorrow I will continue.

Just one question, the program ask the player for her/his name but never use it again... do you like to put the name on the congrats screen ?

Can you tell me what lines do you correct in the new version?

Cheers,
Gus

P.D. On the zx81 there aren't apostrophes (') so I can't write DUNRIC'S 8K ADVENTURE :lol: :lol: :lol: :lol:
Attachments
screen1.gif
ADV8K Player on someplace Screenshot :)
(947 Bytes) Downloaded 9372 times
screen0.gif
ADV8K Splash Screen :)
(723 Bytes) Downloaded 9367 times

Paul Panks
Posts: 62
Joined: Sun May 25, 2008 7:23 pm

Re: 8K Adventure ported to the ZX-81?

Post by Paul Panks » Sat Jun 07, 2008 3:53 am

Hey gus,

Thanks for the neat update. :) I can't wait to see the final version.

Here are the corrections to the previous version:

Edit or add these lines below

Code: Select all

90 NEXT X: IF N=0 AND V<>4 AND V<>7 AND V<>8 AND V>9 AND V<17 OR N>20 THEN PRINT "CAN'T DO THAT": GO TO 80
91 IF N=0 AND v<>7 THEN PRINT"HOW?":GO TO 80

User avatar
yerzmyey
Posts: 1239
Joined: Thu May 15, 2008 10:11 am
Location: Rubber Planet
Contact:

Re: 8K Adventure ported to the ZX-81?

Post by yerzmyey » Sat Jun 07, 2008 2:41 pm

...and if we're talking about it already (maybe I will not put new thread of it) - has ZX81 "!" sign?
IN NIHILUM REVERTERIS - a big text-adventure game for ZX81: http://tiny.pl/g2m6m
"MONOCHROME" issue 5 - (Spring 2014) free paper/PDF magazine about ZX81: http://tiny.pl/q2m44
ZX81 COMPETITIONS 2007/2009: http://zx81.republika.pl/

User avatar
BrunoFlorindo
Posts: 289
Joined: Sat May 10, 2008 2:46 am
Location: Anaheim, CA, USA

Re: 8K Adventure ported to the ZX-81?

Post by BrunoFlorindo » Sat Jun 07, 2008 3:52 pm

Looking great! I'm really happy to see this happening. We need this kind of activity to get the forum going. Thanks gus!

Post Reply