Chase

See all articles from SYNC v2 n5
Soldiers with rifles in front of an armored vehicle
Soldiers with rifles in front of an armored vehicle

Chase is a game of survival. The object is to survive as long as you can. You are set in a playing field, shown as a 20×10 block on your TV screen, surrounded by a lethal fence. Mines are scattered about in the field. You are being chased by five robots which will move straight toward you by means of their unerring sensors. You must destroy them before they destroy you; however, your only weapon is the minefield itself. Thus you must maneuver so that the mines will destroy the pursuing robots. But, beware! You also can be destroyed by touching the mines or the fence. Your energy goes up by one as each robot is destroyed. “H.S.” means the highest score in previous games. Staying alive means that you must destroy as many robots as possible and hence beat the highest score. When your energy is higher than the H.S. shown, your energy will become the highest score in the next game. (At this point you may want to save the program again with the new high score.) If you are successful in destroying the five robots, you will be transported to another 20×10 field with a new mine configuration and five more robots chasing you.

Because of the limited space, this program is a hybrid of machine language and Basic. By using machine language, the time that it takes to print the whole image along with the calculations is less than two seconds. Changes of the pattern during the game are POKEd directly into the screen instead of printing the whole pattern again.

The symbols used are:

+ (in inverse video)  = robot
* (in inverse video)  = you
X                     = fence or mines
█                     = fence

You control your movements by pressing the number keys according to the following diagram:

    1   2   3
       |  /
  8 <---+---> 4
     /  |  
    7   6   5

Directions:

1) Enter Listing 1, lines 1-660. At this point SAVE the program and SAVE it frequently from here on.

2) From this point on do not press RUN, CLEAR, HOME, or LIST without a line number.

3) Type in Listing 2. Then enter GOTO 2000 without a line number and press NEWLINE.

4) Enter the values in Listing 3. After each number hit NEWLINE (do not enter the commas). This must be done very carefully.

5) Type in Listing 4. Enter GOTO 2000 without a line number and press NEWLINE.

6) Type in Listing 5. Then enter GOTO 2000 without a line number and press NEWLINE.

7) Delete lines 2000-2010 by typing just the number and NEWLINE.

8) Type in with no line numbers:

LET F=100 and NEWLINE
LET G=0 and NEWLINE

8) You are now ready to embark on the Chase. Press GOTO 50, and the Chase field will appear.

9) If you want a hyperspace leap, add the following lines:

365 IF Y=10 THEN LET C=RND(18)
367 IF Y=10 THEN LET B=RND(8)

However, you must shorten the print statements to accommodate these lines.

10) For those who want to modify the program:

USR(16427): prints the outside fence of the field.

USR(16482): gives the memory location of the screen.$

USR(16487): increments the units of memory.

Sample Run: the fenced field with X mines, + robots and the * player; "ENERGY 100   H.S. 100"
Sample Run: the fenced field with X mines, + robots and the * player; "ENERGY 100 H.S. 100"

Listing 1.

  1 REM 12345678901234567890123
45678901234567890123456789012345
6789012345678901234567890
10 PRINT "YOU HAVE DESTROYED T
HE ENEMY"
20 INPUT A$
50 FOR D=1 TO 21
60 LET A(20*E(D)+F(D))=0
70 NEXT D
80 IF G=5 THEN GOTO 110
100 LET K=100
110 LET G=0
120 RANDOMISE
130 LET A=USR(16427)
140 PRINT "ENERGY=";K,"H.S.";F
150 FOR D=1 TO 21
160 LET C=RND(18)
170 LET B=RND(8)
180 LET M=20*B+C
190 IF A(M) THEN GOTO 160
200 LET A(M)=61
210 IF D<6 THEN LET A(M)=147
220 IF D=6 THEN LET A(M)=148
230 LET E(D)=B
240 LET F(D)=C
250 POKE USR(16482)+M+B, A(M)
260 NEXT D
270 LET B=E(6)
280 LET C=F(6)
290 LET M=20*B+C
300 LET A(M)=0
310 INPUT Y
320 IF Y THEN POKE USR(16482)+M
+B,0
330 IF Y=1 OR Y=2 OR Y=3 THEN L
ET B=B-1
340 IF Y=5 OR Y=6 OR Y=7 THEN L
ET B=B+1
350 IF Y=1 OR Y=8 OR Y=7 THEN L
ET C=C-1
360 IF Y=3 OR Y=4 OR Y=5 THEN L
ET C=C+1
370 LET M=20*B+C
380 IF A(M)=61 THEN PRINT "YOU#
TOUCHED THE FENCE"
390 IF A(M)=147 THEN PRINT "YOU
#BUMPED INTO THE ENEMY"
400 IF A(M)=147 OR A(M)=61 THEN
#GOTO 660
410 POKE USR(16482)+M+B,148
420 LET A(M)=148
430 LET E(6)=B
440 LET F(6)=C
450 FOR D=1 TO 5
460 LET M=20*E(D)+F(D)
470 IF A(M)-147 THEN GOTO 610
480 LET A(M)=0
490 POKE USR(16482)+M+E(D),0
500 IF E(D)<B THEN LET E(D)=E(
D)+1
510 IF E(D)>B THEN LET E(D)=E(
D)-1
520 IF F(D)<C THEN LET F(D)=F(
D)+1
530 IF F(D)>C THEN LET F(D)=F(
D)-1
540 LET M=20*E(D)+F(D)
550 IF A(M)-61 THEN POKE USR(1
6482)+M+E(D),147
560 IF A(M)=148 THEN PRINT "YO
U HAVE BEEN DESTROYED"
570 IF A(M)=0 OR A(M)=148 THEN
#GOTO 610
580 LET K=K+1
590 LET G=G+1
600 LET A=USR(16487)
610 IF A(M)=0 THEN LET A(M)=14
7
620 IF G=5 THEN GOTO 10
630 IF A(M)=148 THEN GOTO 660
640 NEXT D
650 GOTO 270
660 IF K>F THEN LET F=K

Listing 2.

2000 FOR X=16427 TO 16506
2001 INPUT A
2002 PRINT A,
2003 POKE X,A
2004 NEXT X

Listing 3.

42,12,64,35,205,74,64,6,8,197,
54,9,35,6,18,54,0,35,16,251,54,
9,35,62,117,60,119,35,193,16,
234,6,20,54,9,35,16,251,62,117,
60,119,35,34,14,64,34,16,64,62,
13,50,37,64,201,42,12,64,35,201,
42,12,64,6,0,14,220,9,126,254,
37,40,02,52,201,54,28,43,24,244

Listing 4.

2000 DIM E(21)
2001 DIM F(21)
2002 FOR D=1 TO 21
2003 LET E(D)=0
2004 LET F(D)=0
2006 NEXT D

Listing 5.

2000 DIM A(200)
2001 FOR B=0 TO 9
2002 FOR C=0 TO 19
2003 LET M=20*B+C
2004 LET A(M)=0
2006 IF B=0 OR B=9 OR C=0 O
R C=19 THEN LET A(M)=61
2008 NEXT C
2010 NEXT B

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