The 8K ROM and 16K RAM have given ZX80/81 users new possibilities in programming their own games. Alien Treasure is an example of how some of these new capabilities may be used.
In Alien Treasure two kinds of treasure are scattered over the surface of a planet far from earth. Your ship has landed, and you have sent out your robot searcher which you guide from your control room. The field of search shows on your ZX81 as a full screen display. The treasure is marked by inverse video periods which are worth one point each and by inverse video asterisks which are worth 10 points each. (You can set the values in your own currency if you wish.) However, there are always hazards in searching for treasure. In this case a powerful monster is guarding the search area. While your robot is attempting to pick up the treasures, you must guide it to avoid this monster which appears on your screen as an inverse video 0. Your robot, shown as a graphic square, is moved about by the use of the cursor control keys 5, 6, 7, and 8. The robot also can take a jump away to a random position in the same column by using the 0 key. However, you must use this 0 key with caution because the robot may land right on top of the monster.
The current total of your successful treasure gathering is displayed on the screen in the upper left corner. The total you must beat is displayed to the right of yours.
The game uses a 22 * 32 array to keep track of the treasure locations. When the game is run, it takes about 20 seconds for the screen and the array to be set up and loaded with the proper values. So do not hit the BREAK key too soon because you think the program is in an infinite loop.
Before you SAVE this program, execute the CLEAR command. Otherwise you will save the entire array along with the program, and it will take much longer to SAVE and LOAD in the future.
Alien Treasure has proved to be an interesting and challenging game for those who have tried it so get out your keyboard and start the search.
Line notes:
30: inverse space
36: inverse asterisk
44: inverse period
65: inverse zero
66: inverse graphics on A
73: inverse letters in “”
85: inverse space
89: inverse space
1 LET C1=0
2 REM TREASURE CHASE
4 REM BY GARY G. CHANDLER
5 LET X=0
6 LET Y=16
7 LET Y1=Y
8 LET X1=X
9 LET A=INT (RND*22)
10 LET B=INT (RND*32)
12 LET C=0
20 DIM H(22,32)
26 FOR I=0 TO 21
28 FOR J=0 TO 31
30 PRINT AT I,J;"[inv ]"
31 IF I=0 OR J=0 THEN GOTO 50
32 IF NOT RND<.05 THEN GOTO 40
34 LET H(I+1,J+1)=2
36 PRINT AT I,J;"[inv *]"
40 IF NOT RND<.1 THEN GOTO 50
42 LET H(I+1,J+1)=1
44 PRINT AT I,J;"[inv .]"
50 NEXT J
60 NEXT I
65 PRINT AT X,Y;"[inv 0]"
66 PRINT AT A,B;"[inv gA]"
67 IF H(A+1,B+1)=2 THEN LET C=C+10
68 IF H(A+1,B+1)=2 THEN LET H(A+1,B+1)=0
69 IF H(A+1,B+1)=1 THEN LET C=C+1
70 IF H(A+1,B+1)=1 THEN LET H(A+1,B+1)=0
72 IF C>C1 THEN LET C1=C
73 PRINT AT 0,0;"[inv, 4 letters illegible]";C;AT 0,9;"[inv, about 11 letters, illegible; appears to read HIGH SCORE]";AT 0,21;C1
80 PAUSE 9000
81 IF A>X THEN LET X1=X+1
82 IF A<X THEN LET X1=X-1
83 IF B>Y THEN LET Y1=Y+1
84 IF B<Y THEN LET Y1=Y-1
85 PRINT AT X,Y;"[inv ]"
86 LET X=X1
87 LET Y=Y1
88 IF X=A AND Y=B THEN GOTO 200
89 IF NOT INKEY$="" THEN PRINT AT A,B;"[inv ]"
95 IF INKEY$="0" THEN LET A=INT (RND*22)
98 IF INKEY$="5" THEN LET B=B-1
100 IF INKEY$="8" THEN LET B=B+1
110 IF INKEY$="6" THEN LET A=A+1
120 IF INKEY$="7" THEN LET A=A-1
132 IF A>21 THEN LET A=21
133 IF A<1 THEN LET A=1
134 IF B>31 THEN LET B=31
135 IF B<0 THEN LET B=0
140 IF X=A AND Y=B THEN GOTO 200
160 GOTO 65
200 PRINT AT 10,10;"**GOT YOU**"
202 PRINT AT A,B;"X"
205 PRINT AT 20,2;" PLAY AGAIN INPUT Y OR N "
207 INPUT G$
208 IF G$="N" THEN STOP
210 GOTO 5
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.