Galaxy Invaders

See all articles from SYNC v2 n4

In Galaxy Invaders you are under attack by a fleet of enemy spacecraft which you must destroy before they destroy you. This game uses the ZX80’s 1K RAM, graphics, and screen blackout characteristics to produce an arcade type game. The program (see Listing 1) is fairly simple, but it employs techniques which are used in the popular arcade games: 1) insufficient information (you know they are coming, but you do not know when); 2) the ability to play all day (if you are good enough); and 3) a running point total (for self-satisfaction).

A typical game goes like this: First, the title block appears. You climb aboard one of the three attack ships in your squadron, prepare yourself for the worst, hit NEWLINE, and blast off into space. Suddenly, you see the enemy ships approaching! You immediately hit your firing button (NEWLINE) as quickly as possible. The enemy craft disappear quickly, but not before you hit one of their small reconnaissance ships with a deadly phaser. Your onboard computer evaluates your shot. Each ship you hit is worth either one or two points. Since your objective is to destroy as many ships as possible, a high point total is the measure of a successful mission. Your new point total is displayed along with the number of ships you have hit. NEWLINE returns you to outer space for the next round of the battle.

We must note some of the features of the equipment that shape the battle strategy. Both squadrons are equipped with advanced radar firing which insures pinpoint accuracy. However, the enemy’s phasers are capable of jamming your detection gear and vice versa. This insures your accuracy and disrupts the enemy’s firing.

The scores in this game generally range from 50 to 100. If you get over 150, you rank among the best space pilots in the galaxy. However, if you do not seem able to win a battle, you will have to have your engineers redesign the capability of your attack ships by increasing the value of C in lines 80-90 by 20 or more.

For those who have more than 1K RAM the step in Listing 2 gives a bonus ship at 250 points.

May the luck of the galaxy warriors be with you!

Listing 1: Galaxy Invaders; 4K ROM, 1K RAM.

  2 RANDOMISE
4 CLS
6 LET P=0
8 LET Z=3
10 PRINT ,"GALAXY INVADERS"
12 GO SUB 76
14 CLS
16 FOR I=1 TO 20*RND(100)
18 NEXT I
20 POKE 16414,0
22 POKE 16415,0
24 GO SUB 70
26 LET A=PEEK(16414)
28 LET B=PEEK(16415)
30 LET C=256*B+A-4
32 CLS
34 IF C<8 THEN GO TO 62
36 IF C<9 THEN GO TO 94
38 IF C<13 THEN GO TO 97
40 PRINT "YOU WERE HIT BY PHASER"
42 LET Z=Z-1
44 IF NOT Z=1 THEN PRINT Z;"#SHIPS LEFT"
46 IF Z=1 THEN PRINT Z;"#SHIP#LEFT"
48 IF NOT Z=0 THEN GO TO 101
50 PRINT "POINTS ACCUMULATED:#";P
52 PRINT "START OVER IN NEW GALAXY?"
54 INPUT W$
56 IF CODE(W$)=62 THEN RUN
58 CLS
60 STOP
62 PRINT "DESTROYED ENTIRE FLEET"
64 PRINT "GOOD WORK."
66 LET P=P+4+RND(3)
68 GO TO 99
70 CLS
72 PRINT ,"SHOOT NOW"
74 PRINT ,"=====#==="
76 PRINT
78 PRINT
80 PRINT,,"SD"
82 PRINT
84 PRINT,"##A"
86 PRINT,"TAAAT"
88 PRINT, "#G#G",,"SD"
90 PRINT
91 PRINT "SD"
92 INPUT W$
93 RETURN
94 PRINT "DESTROYED SMALL GROUP"
95 LET P=P+2+RND(2)
96 GO TO 99
97 PRINT "DESTROYED 1 SMALL CRAFT"
98 LET P=P+RND(2)
99 PRINT "POINTS:#",P
101 INPUT W$
102 GO TO 14

Listing 2: Bonus Ship; 4K ROM, over 1K RAM.

  3 LET X=0
100 IF P>249 AND X=0 THEN GO SUB 104
104 PRINT "** BONUS SHIP **"
106 LET Z=Z+1
108 LET X=1
110 RETURN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.