Popular Computing Weekly 02/12/1982 Page 21

Open Forum

Galaxy on ZX81
By Eve Gorton

This is a program for the ZX81 with 16K Ram. The program sets up a screenful of
stable stars (inverse *) with ten target of unstable stars (graphics shifted
A). In your spaceship (equals sign) you move around the galaxy, using the
cursor keys, in an attempt to wipe out the unstable stars. Each unstable star
destroyed gives five points; each stable star inadvertently wiped out costs one
point.

Each time an unstable star is destroyed, a number of black holes are created.
Falling into a black hole brings the game to a sudden end. Otherwise, the game
is ended by reaching the safety base, inverse S, which will give the final
score, together with the best possible score of 50.

Program notes:

Lines:

20-70		Gives instructions and explains the game.

80-95		Completes instructions, warning of seven second out of screen.

100-190		The screen will be blank for approximately seven seconds whilst the
            program:

		1 Prints a black screen.
		2 Prints 115 stars in random positions.
		3 Places 10 targets in random places.
		4 Places the safety zone (inverse S) in a random position along the bottom line of the black screen.

200-280     Gives loop for moving spaceship; checks position of the spaceship;
            limits values of X and Y to width and height of screen; if line 265
            shows that the program goes to 500.

400-430     Gives final score and ends game.

500-550     Sends program to appropriate subroutine for value of W. (W = the
            object hit point reached by spaceship).

1000-1070   Subroutine for destroying unstable star; adds five to value of S;
            creates black holes in random positions; returns.

2000-2010	Subroutine for destroying stable star; reduce S by 1; returns.

5000-5030	Blacks out screen, ends game.