--- title: "Cavern" id: 77804 type: "computer_media" slug: "cavern" url: "http://localhost/computer_media/cavern/" markdown_url: "http://localhost/computer_media/cavern.md" published_at: "2026-11-19T12:55:00+00:00" modified_at: "2026-11-19T12:55:00+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/cavern-1.png" excerpt: "A two-stage cave flying game for the TS2068: steer through a random brick maze, then a scrolling second cave, with five lives." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Charles Eric Goyette" slug: "charles-eric-goyette" taxonomy: "indiv" url: "http://localhost/indiv/charles-eric-goyette/" genre: - name: "Arcade" slug: "arcade" taxonomy: "genre" url: "http://localhost/type/arcade/" media_type: "Program" programmers: - name: "Charles Eric Goyette" slug: "charles-eric-goyette" taxonomy: "indiv" url: "http://localhost/indiv/charles-eric-goyette/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Cavern%20%281986%29%28Goyette%2C%20Charles%20Eric%29%28TS2068%29%28CA%29%28Program%29.zip" tsrun_member: "Cavern (1986)(Goyette, Charles Eric)(TS2068)(CA)(Program)/Cavern (1986)(Goyette, Charles Eric)(TS2068)(CA)(Program).tap" mediadate: "1986" images: - url: "http://localhost/wp-content/uploads/2026/11/cavern-1.png" - url: "http://localhost/wp-content/uploads/2026/11/cavern-2.png" article_media: - id: 6298 title: "Cavern: A Space Arcade Game" type: "article" url: "http://localhost/article/cavern-a-space-arcade-game/" - id: 6305 title: "Letters" type: "article" url: "http://localhost/article/letters-3/" media_type_tags: "Arcade" license: false --- # Cavern A two-stage cave flying game. After a title screen and instructions you set the visibility, which is how much of the maze ahead you can see. In the first maze your ship flies right through a randomly carved cave of brick; H moves it up and B moves it down. Touching a wall costs one of five lives, and reaching the stars at the end leads to the second maze. In the second maze the cave scrolls up the screen and keys 5 and 8 steer left and right toward the ++ exit. Getting through makes you the Super Champion, and your name goes on the title screens. The program plays engine noise on the TS2068 sound chip with OUT 245/246. The program is shipped as printed. Line 47 jumps to a missing line 80, so a visibility outside 5-25 is accepted anyway (the prompt asks for 8-24). Line 9998 was printed with a semicolon in “112,0;0,120”, which cannot be typed into a DATA line; the file has a comma. In a later letter the author said Cavern “had a few bugs and it was slow.” Published in Time Designs May/June 1986 ([Cavern: A Space Arcade Game](https://timexsinclair.com/article/cavern-a-space-arcade-game/)). ## Source Code ``` 1 LET O=245: LET P=246: PRINT PAPER 6; INK 1; FLASH 1;AT 10,5;"STOP THE TAPE": FOR F=1 TO 670: NEXT F: LET H$="XXXXXXX": REM 2 OUT o,7: OUT p,63: LET NN=0: BORDER 1: PAPER 1: INK 6: CLS : GO SUB 3000 3 CLS : OUT O,7: OUT P,60: OUT O,8: OUT P,11: OUT O,9: OUT P,11: OUT O,0: OUT P,200: OUT O,2: OUT P,180 4 RESTORE 9900: GO SUB 9900 5 LET M=4 6 BORDER 1: PAPER 1: CLS : INK 6: PRINT FLASH 1;AT 10,8;"PLEASE WAIT" 7 DIM A$(4,400) 8 PRINT FLASH 1;AT 4,0;" :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::" 9 PRINT FLASH 1;AT 20,0;":: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: " 10 FOR F=5 TO 19 STEP 2: PRINT FLASH 1;AT F,0;"::";AT F+1,31;" ": NEXT F 11 FOR F=4 TO 18 STEP 2: PRINT FLASH 1;AT F,0;" ";AT F+1,31;"::": NEXT F 12 REM CLEAR : FOR l=1 TO 9e9: SAVE "CAVERN" LINE 1: NEXT L 19 FOR F=1 TO 4: FOR G=10 TO 391 STEP 10: LET A$(F,G TO G+9)="aaaaaaaaaa": NEXT G: NEXT F 20 FOR F=10 TO 382 25 LET L=INT (RND*2) 30 IF L=1 THEN LET M=M+1 32 IF L=0 THEN LET M=M-1 34 IF M>4 THEN LET M=4 36 IF M<1 THEN LET M=1 40 LET A$(M,F TO F+3)=" " 42 IF F=378 THEN LET A$(M,F TO F+3)="****": LET F=F+2 45 NEXT F 46 BEEP .2,15: INPUT "VISIBILITY?(8-24) ";Z 47 IF Z<5 OR Z>25 THEN GO TO 80 48 PRINT " USE 'B' AND 'H' ": PAUSE 0 50 LET A=1: LET B=10: LET L=1 55 BORDER 0 60 REM PRINT AT 0,0;: FOR F=0 TO 21: PRINT "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::": NEXT F 62 PAPER 0: CLS : PAPER 7 88 FOR F=5 TO 5+Z 90 PRINT INK 1;AT 7,F;"a";AT 12,F;"a" 92 NEXT F 93 PRINT AT 0,2; INK 7; PAPER 0;"SUPER CHAMPION:";H$ 95 FOR F=1 TO 80: NEXT F: BEEP .3,10 100 LET A=A+1 105 LET K=(RND*100)+100: OUT O,0: OUT P,K: OUT O,2: OUT P,K+5 110 FOR F=1 TO 4 115 PRINT INK 1;AT F+7,5;A$(F,A TO A+Z) 120 PRINT INK 0;AT B,7;"bcd" 130 NEXT F 135 IF INKEY$="H" OR INKEY$="h" THEN LET B=B-1: PRINT AT B,7; INK 0;"bcd";AT B+1,7;" " 140 IF INKEY$="B" OR INKEY$="b" THEN LET B=B+1: PRINT AT B,7; INK 0;"bcd";AT B-1,7;" " 150 IF SCREEN$ (B,10)<>" " THEN GO TO 1000 199 GO TO 100 1000 IF SCREEN$ (B,10)="*" THEN PRINT FLASH 1; INK 0; PAPER 7;"BRAVO!!!!!!!!!": BORDER 6: FOR F=1 TO 100: NEXT F: GO TO 4000 1010 PRINT INK 7; PAPER 0; FLASH 1;"BOOM!!!!!!": LET NN=NN+1: PAUSE 10 1011 PRINT INK 0;AT 1,0;"YOU HAVE NOW ";5-NN;" LIVES ": PAUSE 50: IF NN=5 THEN GO TO 8500 1015 PAUSE 20 1020 FOR F=1 TO 5 1025 BORDER 7: PAUSE 5: BORDER 0 1027 PAPER 7: CLS : PAPER 0: CLS 1030 NEXT F 1040 FOR F=1 TO 50: NEXT F: GO TO 50 2000 FOR F=5 TO 250 STEP 5: PLOT F,0: DRAW INK 2;0,165: NEXT F 2020 PAUSE 50: GO TO 2 3000 PRINT AT 5,0;":::::::: :::: :: :: :::::::: :::::::: :: ::" 3005 PRINT AT 6,0;":: :: :: :: :: :: :: :: :::: ::" 3010 PRINT AT 7,0;":: :: :: :: :: :: :::::::: :: :: ::" 3015 PRINT AT 8,0;":: :::::::: :: :: :::::: :::: :: :: ::" 3020 PRINT AT 9,0;":: :: :: :: :: :: :: :: :: :: ::" 3025 PRINT AT 10,0;":: :: :: :: :: :: :: :: :: ::::" 3030 PRINT AT 11,0;":::::::: :: :: :: :::::::: :: :: :: ::" 3040 PRINT AT 13,2;"*1985 CHARLES-ERIC GOYETTE " 3060 FOR F=0 TO 172 STEP 4 3070 PLOT 0,F: DRAW 251,0 3075 BEEP .005,F/3 3080 NEXT F 3090 FOR F=0 TO 255 STEP 4: BEEP .008,F/4: PLOT F,0: DRAW 0,172: NEXT F 3095 BEEP .03,10: PRINT AT 13,1;" *1985 CHARLES-ERIC GOYETTE ": BEEP .04,15: BEEP .13,10 3100 INPUT "TYPE 'ENTER' PLEASE";Q$ 3200 CLS : PAUSE 20 3210 PRINT AT 1,0;"THE KEY 'H' IS FOR GOING UP" 3212 PAUSE 40 3215 PRINT AT 3,0;"THE KEY 'B' IS FOR GOING DOWN" 3217 PAUSE 40 3220 PRINT AT 5,0;"THE VISIBILITY IS EQUAL TO THE LENGHT OF MAZE THAT YOU CAN SEE." 3222 PAUSE 40 3225 PAUSE 100: PRINT AT 18,2;"THE SUPER CHAMPION IS ";H$: BEEP .2,5: BEEP .2,8: BEEP .3,15: BEEP .4,12 3230 INPUT "TYPE 'ENTER' TO BEGIN";Q$ 3300 RETURN 4000 BORDER 0: INK 1: GO SUB 8000 4001 DIM A$(200,32) 4002 BEEP .3,10: INPUT "VISIBILITY?(8-20)";VI: LET VV=21-VI 4003 IF VI<8 OR VI>20 THEN GO TO 4002 4004 PRINT " PLEASE WAIT" 4005 LET K$="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" 4010 FOR F=1 TO 200: LET A$(F)="gggggggggggggggggggggggggggggggg": NEXT F 4015 LET L=13 4020 FOR F=1 TO 180 4025 LET S=INT (RND*5)-2 4030 LET L=L+S 4035 IF L<2 THEN LET L=2 4040 IF L>25 THEN LET L=25 4045 LET A$(F,L TO L+6)=" " 4050 IF F=176 THEN LET A$(F,L+3 TO L+4)="++" 4053 NEXT F 4055 CLS : BEEP .3,10 4060 LET Z=1 4065 LET B=14 4070 POKE 23692,255 4075 PAPER 7: CLS 4077 PRINT AT 0,1;"USE '5' OR '8'.": PAUSE 2550 4080 POKE 23692,255 4100 PRINT AT 21,0;A$(Z);" ";AT VV-1,B-1;" " 4102 OUT o,0: OUT p,(Z/1.5) 4105 LET Z=Z+1 4110 PRINT AT VV,B;"el" 4115 IF SCREEN$ (VV+1,B)<>" " THEN GO TO 5000 4120 IF SCREEN$ (VV+1,B+1)<>" " THEN GO TO 5000 4130 IF INKEY$="5" THEN LET B=B-1 4135 IF INKEY$="8" THEN LET B=B+1 4200 GO TO 4100 5000 IF SCREEN$ (VV+1,B)="+" OR SCREEN$ (VV+1,B+1)="+" THEN PRINT FLASH 1;AT VV+1,B-2;"BRAVO!!": FOR F=1 TO 50: NEXT F: PAUSE 10: GO TO 6000 5005 LET NN=NN+1: PRINT AT 1,0;"YOU HAVE NOW ";5-NN;" LIVES": PAUSE 20: IF NN=5 THEN GO TO 8500 5010 FOR F=1 TO 10: FOR F=1 TO 10 5015 PRINT AT VV,B;"po" 5016 BEEP .004,F*5 5025 NEXT F 5027 PAUSE 50 5030 GO TO 4055 6000 PRINT AT VV+1,B-3;" ": BORDER 6: INPUT " "; 6005 BORDER 6: INK 1: LET A=175: LET B=255: FOR F=0 TO 85 6010 PLOT F,F: DRAW B,0: DRAW 0,A: DRAW -B,0: DRAW 0,-A 6020 LET A=A-2: LET B=B-2: NEXT F 6030 PRINT FLASH 1; PAPER 6;AT 10,2;"YOU ARE THE SUPER CHAMPION!" 6035 INPUT "YOUR NAME ? ";H$: PRINT INK 1; PAPER 6;AT 11,10;"BRAVO ";H$;" !" 6040 PAUSE 200: GO TO 2 8000 DATA 3,192,31,248,60,60,63,252,31,248,9,144,16,8,48,12 8001 RESTORE 8000: FOR F=0 TO 7 8002 READ G,H 8003 POKE USR "E"+F,G 8004 POKE USR "L"+F,H 8005 NEXT F 8006 DATA 60,90,153,255,255,153,90,60 8007 FOR F=0 TO 7 8008 READ Q: POKE USR "G"+F,Q: NEXT F 8011 DATA 68,68,34,152,18,160,0,4,248,3,2,146,52,201,196,76 8012 FOR F=0 TO 7: READ Q,W 8013 POKE USR "P"+F,Q 8014 POKE USR "O"+F,W 8015 NEXT F 8020 CLS : PRINT AT 10,0;" AND NOW THE SECOND MAZE..." 8050 RETURN 8500 CLS : PRINT AT 10,12; FLASH 1;"YOU LOST." 8505 FOR F=1 TO 100: NEXT F 8510 PRINT AT 15,0;"BETTER LUCK NEXT TIME.": BEEP .5,-5: BEEP .4,-10: BEEP .3,-17: GO TO 2 9000 RETURN 9900 FOR F=0 TO 7 9905 READ A 9910 POKE USR "A"+F,A 9915 NEXT F 9930 FOR F=0 TO 7 9940 READ A,B,C 9950 POKE USR "B"+F,A 9955 POKE USR "C"+F,B 9956 POKE USR "D"+F,C 9960 NEXT F 9970 RETURN 9995 DATA 255,68,68,68,255,17,17,17 9998 DATA 224,0,0,112,0;0,120,0,0,255,255,224,30,63,254,15,128,255,7,255,252,0,0 9999 DATA 0 ```