Re: 2k adventure
Posted: Thu Nov 22, 2018 9:10 pm
I'll check the download later good sir, having thanksgiving in a bit. Enjoy your day
Discussion forums for users of the Sinclair 8-bit range of computers - ZX80, ZX81, ZX Spectrum, Z88, clones...
https://sinclairzxworld.com/
Without losing functionality a lot of bytes can be lost
Code: Select all
10 SAVE "ADV2k"
60 PRINT "YOU ARE IN ";R$(R),"THERE IS ";O$(R),,,"YOU CAN GO:",,(N$ AND R<V3),,(S$ AND R<V4),,(E$ AND R=V4),,(W$ AND R=V2)
100 INPUT A$
110 CLS
120 IF R<>V1 OR L=V1 OR A$<>"LAMP" THEN GOTO VAL "160"
130 PRINT "YOU HAVE ";O$(R),"AND CAN BARELY SEE ";O$(V2);"TO THE ";N$,,,,
140 LET L=V1
150 LET O$(R)=Z$
160 IF R<>V2 OR S=V1 OR A$<>"SWORD" THEN GOTO VAL "200"
170 PRINT "YOU CLUTCH ";O$(R),,,
180 LET S=V1
190 LET O$(R)=Z$
200 IF R<>V3 OR T=V1 OR A$<>"TREASURE" THEN GOTO VAL "240"
210 PRINT "YOU TAKE ";O$(R),,,
220 LET T=V1
230 LET O$(V3)=Z$
240 IF R<>V2 OR A$<>W$ OR P=V1 OR L=V1 THEN GOTO VAL "270"
250 PRINT "IN THE DARK YOU CANT SEE ",O$(V4),," AND YOU ARE INJURED",,,
260 LET P=V1
270 IF A$=S$ AND R=V1 THEN GOTO VAL "330"
280 IF A$=N$ AND R<V3 THEN LET R=R+V1
290 IF A$=S$ AND R<V4 THEN LET R=R-V1
300 IF A$=W$ AND R=V2 THEN LET R=V4
310 IF A$=E$ AND R=V4 THEN LET R=V2
320 GOTO VAL "30"
330 PRINT "YOU ESCAPE THE CAVE",,,
350 PRINT "YOU HAVE THE TREASURE" AND T=V1;AT V3,V0;"YOU WIELD THE MAGIC SWORD" AND S=V1;AT VAL "5",V0;"BUT YOU ARE INJURED" AND P=V1
I'm sure David Horne was a lot older than 16 when he wrote 1k chess.TMAOne wrote: ↑Sun Nov 25, 2018 7:38 pm I won't be expanding it. As a 2K Adventure game it was a development novelty only--a fun exercise in coding.
A full-RAM version with more rooms and features would require a redesign of some of the compromises to make to fit into 2K, and Adventure games abound in the wilds. (I think the one I posted in this thread is particularly nice, but I'm biased.)
I do credit you Crayon21 with coming up with the challenge of fitting a BASIC Adventure style game into an un-expanded TS1000. That was key for me. It was a neat idea that started me thinking in Sinclair BASIC again.
No one however, is ever going to beat that kid, (I think he was 16?) who created 1KCHESS. Just incredible,...
Keep coding Crayon21. Arrays and loops are your friends. Your game would do better with more RAM available. Cheers.
Ian
I made a version based on this one, with small amends to the grammar it's under 900 bytes saved. Do not RUN it or you will lose some of the var stack.XavSnap wrote: ↑Thu Nov 22, 2018 6:38 am2KADV.PCode: Select all
1 LET R=PI/PI 5 LET L=NOT R 10 LET Q=NOT PI/PI 20 PRINT ,,("YOU ARE IN A CAVE." AND R=1);(" IN THE CAVE IS A LAMP" AND NOT L AND R=1);(" LAMP TAKEN, YOU CAN NOW SEE FURTHER." AND L=1 AND R=1);(" THE CAVE IS NOW BRIGHT AND YOU CAN SEE THE TREASURE I THE DISTANCE" AND L=1 AND R=1);("TRAP SPRUNG. YOU ARE NOW ONE LEVEL BELOW THE TREASURE." AND R=2);(" THERE IS A LAMP HERE TO REPLACE THE BROKEN ONE" AND R=2 AND NOT L);("YOU CAN GO EAST, WEST OR NORTH" AND R=3 AND L);("YOU GO NORTH AND FIND YOUR WAY BACK.YOU HAVE TAKEN THE TREASURE,YAY" AND R=4);("YOU TAKE THE TREASURE AND HEAD OUT OF THE CAVE" AND R=5) 25 IF R=5 THEN STOP 30 INPUT A$ 40 IF (R=PI/PI OR R=2) AND A$="GET LAMP" THEN LET L=PI/PI 50 IF L AND R=1 AND A$="NORTH" THEN LET Q=PI/PI 60 IF Q THEN LET R=2 70 IF Q THEN LET L=NOT Q 80 IF (L AND R=2)OR(R=3) AND A$="NORTH" THEN LET R=R+PI/PI 100 IF R=4 AND A$="SOUTH" THEN LET R=5 110 CLS 120 GOTO 10
Have fun!