6 Shooter draws its title in large letters, asks for a skill factor from 0 (hard) to 10 (easy), and then moves a target up and down the right-hand edge of the screen. Press any key to fire: the bullet crosses the screen and either hits, with an explosion, or ricochets. After six shots you can reload with L, and the program comments on your accuracy.
The program is the type-in from SYNC v2 n2 (1982) (see the article 6 Shooter). Bob Swoger’s copy was transferred from the TS1000 to the TS2068 with Upload 2000.
Program Analysis
The title is drawn by reading the character set from ROM (PEEK (15616+(J-32)*8+Y)) and plotting each bit as a large pixel. The skill factor sets how long the program waits for a key before the target moves on.
Notable Techniques
- The ricochet path is stored as a string of two-digit coordinates in
R$and read withVALslices.
Potential Issues
- Line 1087 overwrites the ricochet path set in line 1086, so only the second path is ever used.
This copy came from a Larken disk. Upload 2000 had dropped the ZX81 UNPLOT keyword and the program read the ZX81’s character set at 7680, so the PLOT and UNPLOT lines now call a subroutine at 2010 that draws a ZX81-sized 4×4 pixel, the title reads the TS2068 character set, the screen is cleared at the start and the auto-start line was set. Tested in ZEsarUX on a stock TS2068.
Source Code
10 REM ^::6::SHOOTER::^
40 CLS
44 GO TO 1300
50 REM ::CLS::
51 GO SUB 1150
52 PRINT AT TRG-1,30;" "
53 PRINT AT TRG+1,30;" "
55 PRINT AT TRG,31;" "
57 PRINT AT 13,31;" "
59 RETURN
60 REM ::TARGET::GENERATER::
80 PRINT AT TRG,31;" "
90 LET MISS=0
100 LET TRG=INT (RND*17)+4
110 PRINT AT TRG,31;"::"
120 RETURN
130 REM ::SKILL::
140 IF INKEY$<>"" THEN RETURN
150 FOR W=1 TO SKL
160 IF INKEY$<>"" THEN RETURN
170 NEXT W
180 LET MISS=1
190 RETURN
200 REM ::SCREEN::
220 LET X1=0
230 LET T$="6 SHOOTER"
240 PRINT AT 3,0;"................................"
250 FOR I=1 TO LEN T$
260 LET J=CODE T$
270 LET T$=T$(2 TO LEN T$)
280 FOR Y=0 TO 7
290 LET K=PEEK (15616+(J-32)*8+Y)
300 LET L=128
310 FOR X=0 TO 7
320 IF K<L THEN GO TO 350
330 LET u=X+X1: LET v=43-Y: LET w=0: GO SUB 2010
340 LET K=K-L
350 LET L=L/2
360 NEXT X
370 NEXT Y
380 LET X1=X1+7
390 NEXT I
400 PRINT AT 21,0;"HITS=";"0";
410 PRINT "SHOTS=0"
420 PRINT AT 13,0;"':=''''"
430 PRINT AT 14,0;"::"
440 RETURN
450 REM ::SKILL::SELECT::
460 GO SUB 1150
470 PRINT AT 9,5;"SELECT SKILL FACTER"
480 PRINT AT 10,5;"(0=DIFFICULT,10=EASY)"
490 INPUT SKL
500 PRINT AT 8,0
510 FOR I=1 TO 64
520 PRINT " ";
530 NEXT I
550 RETURN
850 REM ^^::TURN::^^
860 IF SHTS>0 THEN GO SUB 50
870 LET TRG=21
880 PRINT AT 13,0;"':"
890 GO SUB 70
900 IF INKEY$<>"" THEN GO TO 960
910 IF TRG<>21 AND MISS<>1 THEN GO SUB 130
920 IF MISS=1 THEN GO SUB 70
940 IF INKEY$="" THEN GO TO 900
960 REM ::BULLET::
970 FOR X=0 TO 63 STEP 9
980 IF X>0 THEN LET u=X-9: LET v=17: LET w=1: GO SUB 2010
990 LET u=X: LET v=17: LET w=0: GO SUB 2010
1000 NEXT X
1010 LET SHTS=SHTS+1
1030 IF TRG<12 OR TRG>14 THEN RETURN
1050 REM ::EXPLO::
1060 PRINT AT TRG,31;"::"
1070 PRINT AT TRG-1,30;"'."
1080 PRINT AT TRG+1,30;".'"
1084 IF TRG=13 THEN GO TO 1130
1085 REM ::RICOCHET::
1086 LET R$="5819572155225322542155235425522750284828492750294931"
1087 LET R$="60195921572255225622157235625542752285028512752295131"
1088 FOR I=1 TO 13 STEP 4
1090 IF I>1 THEN LET u=VAL R$(I-4 TO I+1-4): LET v=VAL R$(I+2-4 TO I+3-4): LET w=1: GO SUB 2010
1091 LET u=VAL R$(I TO I+1): LET v=VAL R$(I+2 TO I+3): LET w=0: GO SUB 2010
1092 NEXT I
1096 LET u=VAL R$(I-4 TO I+1-4): LET v=VAL R$(I+2-4 TO I+3-4): LET w=1: GO SUB 2010
1100 RETURN
1120 REM ::SCORE::
1130 LET HITS=HITS+1
1150 PRINT AT 21,5;HITS
1160 PRINT AT 21,12;SHTS
1180 RETURN
1300 REM ^^::UTILITY::^^
1330 GO SUB 200
1340 LET SHTS=0
1350 LET HITS=0
1360 GO SUB 460
1370
1380 GO SUB 850
1400 GO SUB 1150
1420 IF SHTS<6 THEN GO TO 1380
1430 GO SUB 50
1440 REM ::RELOAD::
1450 PRINT AT 9,5;"HIT::L::TO::RELOAD::*A*(STOP):: ::TO::STOP.::"
1460 PRINT AT 9,5;"HIT"
1470 PRINT AT 9,5;"HIT"
1480 IF INKEY$="" THEN GO TO 1460
1490 IF INKEY$="L" THEN GO TO 1340
1500 IF HITS<=2 THEN PRINT AT 9,5;"YOU NEED PRACTICE"
1590 IF SHTS/HITS<=2 THEN PRINT AT 9,5;" ^::GOOD::SHOOTIN::^ "
1600 IF SHTS/HITS<=2 THEN PRINT AT 9,5;"::**::GOOD SHOOTIN::**::"
1610 IF INKEY$="A" THEN GO TO 1900
1620 GO TO 1590
1900 PRINT "HIT *C* THEN ENTER TO CONTINUE GAME."
1910 STOP
1920 CLS
1930 GO TO 10
2000 REM plot (w=0) or unplot (w=1) one ZX81-size pixel at u,v
2010 FOR q=0 TO 3: PLOT INVERSE w;4*u,4*v+q: DRAW INVERSE w;3,0: NEXT q: RETURNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

