
THE FIRST question often asked about a new machine is “Does it play Space Invaders?” Though a 1K machine has considerable difficulty getting anywhere Computer Combat using only 1K, is a type of mini Space Invaders but with only one invader and one base and a much slower rate of firing.
The object of the game is to hit the invader as many times as possible before it lands or you run out of missiles. Twenty-five missiles normally are given but that can be altered by changing the value of B in line 5.
You receive five points for hitting it but lose one if you miss. Use keys 5 and 8 to move left and right respectively and key 0 to fire. The invaders’ missiles are shown as asterisks and yours as crosses. The program is good for beginners, as it is easy to understand the function of each line as there are none of the usual POKE and PEEK or other complicated functions.
If you want to get more memory, enter in direct mode the following before entering the program: POKE 16389,68 followed by ENTER NEW followed by ENTER.
The program will run continuously until the BREAK key is used.
Computer Combat was sent in by 15-year-old Anthony Wells. (T/S1000,ZX81 16K)
5 LET B=VAL "25"
10 LET S=PI-PI
15 LET M=PI-PI
20 LET X=VAL "16"
25 LET Y=PI-PI
30 LET M=M+2
35 IF M>VALL "20" THEN GOTO VAL "100"
40 CLS
45 LET R=INT (RND*5)
50 IF R=3 THEN GOSUB 155
55 PRINT AT M,Y; "▛█▜"
60 LET Y=Y+VAL "2"
65 IF Y=VAL "30" THEN GOTO 25
70 PRINT AT 21,X;" ▗▙ "
75 LET X=X+(INKEY$="8")*3-(INKEY$="5")*3
80 IF INKEY$="0" THEN GOSUB 115
85 IF B <= VAL "0" THEN GOTO VAL "100"
95 GOTO VAL "40"
100 PRINT AT 12,10;"SCORE=";S
105 PAUSE VAL "300"
110 RUN
115 PRINT AT M,X;"+"
120 IF X+1 <> Y THEN LET S=S-1
125 IF X+1=Y THEN PRINT AT M,X-1;"***"
130 IF X+1=Y THEN LET S=S+5
135 LET B=B-VAL "1"
140 RETURN
145 PAUSE VAL "50"
150 GOTO VAL "40"
155 PRINT AT 21,Y;CHR$ 23
160 IF X=Y THEN GOSUB VAL "170"
165 RETURN
170 PRINT AT 21,Y;"<*>"
175 PAUSE VAL "40"
180 LET S=S-VAL "5"
185 RETURN
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.