Centurion

Type
Game
Category
Tunnel shooter
Author
Jeff Greenway
Published in
Antic, March 1984 (Vol. 2, No. 12), Game of the Month
Year
1984
Language
Atari BASIC
Requirements
Joystick in port 1, Atari BASIC
A black GRAPHICS 0 title screen reading CENTURION, BY JEFF GREENWAY, PRESS START TO PLAY

About the program

Antic's March 1984 issue celebrated Atari users around the world, and its Game of the Month came from Jeff Greenway, 14, of Ontario, Canada. He also drew the artwork and headline for the article. The editors added that when he first wrote to them he was "despondent that no one wanted to publish his work". They thought Centurion was a natural for the international issue.

You command a small scout ship at the entrance to a planetoid that hides the enemy's mother ship. The way in is a long, twisting tunnel, blocked here and there by deadly force fields. Your blasters can't hurt a force field, but a head-on shot through its "air lock" gets you through, for 50 points. The ship keeps moving forward whatever you do. When a collision can't be avoided, push forward for a five-second hyperspace jump, which carries you past a force field but burns fuel fast, and you must come out inside the tunnel, not in a wall. Shoot the randomly placed fuel pods (150 points) to refuel. At the end of the tunnel are four glowing reactors (500 points each) and the mother ship itself (5000). Then blast through one of five air locks and escape, and the tunnel starts again with more force fields. The magazine said a score of 10,000 is very good.

What you need

A joystick in port 1 and Atari BASIC. Line 10 lowers RAMTOP by five pages for a custom character set.

Typing it in

Nearly plain ASCII. The few special characters are {INS LINE} (ESC then SHIFT-INSERT) in lines 760, 820, 1250 and 1420, {ESC}{LEFT} in line 410 (ESC twice, then ESC and CTRL-+) and one {CLEAR}. The tunnel shape is DATA, a pair of wall positions per line. Copy those numbers carefully or the walls will jump about.

How to play

Press START. Steer left and right with the joystick, fire with the trigger and push forward for hyperspace. The fuel gauge across the top shrinks as you fly. Running out costs a ship. You have three ships, and each new one starts with a full tank.

How it works

  • Scrolling with Insert Line. The tunnel is drawn in GRAPHICS 0 with redefined characters. To make it move, line 760 prints the {INS LINE} control character on line 1. The screen editor inserts a blank line there and pushes everything below it down a row. Line 770 then draws the new slice of tunnel walls in the gap from the DATA.
  • Characters as graphics. Line 40 copies the ROM font to RAM, and lines 150–330 redefine ten characters as the ship, walls, force fields and fuel pods. COLOR followed by a character code and PLOT/DRAWTO draw with them like pixels.
  • Animation by redefinition. Lines 660–720 rewrite some bytes of a character on every pass, so every copy of it on the screen flickers at once, without being redrawn.
  • LOCATE checks what lies ahead of the ship. TRAP 1600 sends any error in the main loop, such as running off the screen after the escape, to the "YOU ESCAPED!!" routine.

Listing

5 REM ANTIC MAGAZINE MARCH 1984
6 REM CENTURION
7 REM BY JEFF GREENWAY
10 POKE 106,PEEK(106)-5:GRAPHICS 0:GOSUB 1710:SETCOLOR 2,0,0:POKE 755,224:SETCOLOR 0,8,12
20 DL=PEEK(560)+256*PEEK(561):POKE DL+10,7:POKE DL+11,6
30 POSITION 5,5:? "CENTURION":POSITION 11,7:? "BY JEFF GREENWAY":POSITION 10,9:? "FOR ANTIC MAGAZINE"
40 ST=(PEEK(106)+1)*256:FOR MOV=0 TO 1023:POKE ST+MOV,PEEK(57344+MOV):NEXT MOV
50 HH=10:SH=3:SC=0:TM=0
60 GRAPHICS 0:GOSUB 1710:SETCOLOR 2,0,0:POKE 755,224
70 POSITION 15,10:? "CENTURION":POSITION 12,12:? "BY JEFF GREENWAY"
80 POSITION 10,14:? "PRESS START TO PLAY ."
90 IF PEEK(53279)=6 THEN GOTO 110
100 GOTO 90
110 A=19:B=23:HT=0
120 IF SH<1 THEN GOTO 1680
130 GRAPHICS 0:GOSUB 1710:SETCOLOR 2,0,0:POKE 755,224
140 RESTORE :POKE 82,0
150 FOR MOV=0 TO 7:READ AA:POKE 80+ST+MOV,AA:NEXT MOV
160 DATA 24,24,60,102,219,126,60,24
170 FOR MOV=0 TO 7:READ AA:POKE 96+ST+MOV,AA:NEXT MOV
180 DATA 145,145,145,145,145,145,145,145
190 FOR MOV=0 TO 7:READ AA:POKE 104+ST+MOV,AA:NEXT MOV
200 DATA 60,126,195,207,195,207,207,126
210 FOR MOV=0 TO 7:READ AA:POKE 112+ST+MOV,AA:NEXT MOV
220 DATA 170,0,0,170,0,0,170,0
230 FOR MOV=0 TO 7:READ AA:POKE 120+ST+MOV,AA:NEXT MOV
240 DATA 85,85,85,85,85,85,85,85
250 FOR MOV=0 TO 7:READ AA:POKE 72+ST+MOV,AA:NEXT MOV
260 DATA 231,231,231,231,231,231,231,231
270 FOR MOV=0 TO 7:READ AA:POKE 64+ST+MOV,AA:NEXT MOV
280 DATA 60,126,255,255,255,255,126,60
290 FOR MOV=0 TO 7:READ AA:POKE 672+ST+MOV,AA:NEXT MOV
300 DATA 0,0,60,126,126,60,0,0
310 FOR MOV=0 TO 7:READ AA:POKE 56+ST+MOV,AA:NEXT MOV
320 DATA 67,34,21,89,157,232,111,67
330 FOR MOV=0 TO 7:READ AA:POKE 48+ST+MOV,AA:NEXT MOV
340 DATA 170,170,255,255,255,255,170,170
350 POKE 756,ST/256
360 POSITION 15,10:? "READY!":FOR Z=1 TO 31
370 READ AA:READ BB:FOR ZZ=15 TO 0 STEP -2
375 SOUND 0,AA,10,ZZ:SOUND 1,AA+1,10,ZZ:SOUND 1,BB,10,ZZ:SOUND 1,BB,10,ZZ:NEXT ZZ
380 DATA 108,0,108,0,53,0,53,0,108,0,108,0,53,0,53,0,121,0,121,0,114,0,114,0,108,0,108,0,53,0,53,0,108,217,108,0
390 DATA 53,217,53,0,108,217,108,0,53,217,53,0,121,243,121,243,114,144,96,193,108,217,108,217,53,108
400 NEXT Z:POSITION 15,10:? "      ":SOUND 0,0,0,0:SOUND 1,0,0,0:SOUND 2,0,0,0
410 POSITION 0,0:? SH;"{ESC}{LEFT}"
420 IF SEC<>1 THEN GOTO 460
430 IF SEC=1 THEN COLOR 46:PLOT 0,1:DRAWTO 38,1:COLOR 41
435 PLOT 5,1:PLOT 10,1:PLOT 15,1:PLOT 20,1:PLOT 25,1:PLOT 30,1:PLOT 35,1
440 FOR ZZ=2 TO 10:COLOR 47:PLOT 0,ZZ:DRAWTO 38,ZZ:NEXT ZZ
450 COLOR 38:PLOT 5,4:PLOT 15,4:PLOT 25,4:PLOT 30,4:COLOR 45:PLOT 0,11:DRAWTO 38,11
460 POSITION 15,0:? "FUEL":COLOR 44:PLOT 19,0:DRAWTO 38,0:II=38
470 DATA 15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,16,23,17,22
480 DATA 17,22,17,22,17,22,17,22,17,22,17,22,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33,5,33
490 DATA 10,23,15,23,15,23,15,23,15,23,15,23,15,23,15,23,15,23,15,23,15,23,15,24,15,24,15,24,15,24,15,24,15,24
500 DATA 16,25,17,26,18,27,19,28,20,29,21,30,22,31,23,32,24,33,25,34,26,35,27,36,28,37,28,37,28,37,28,37,28,37
510 DATA 28,37,28,37,28,37,28,37,28,37,28,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37
520 DATA 5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,37,5,30,5,30,5,30,5,30,5,30,5,30,5,30,5,25,5,25,5,25,5,25,5,25
530 DATA 5,25,5,20,5,20,5,20,5,20,5,15,5,15,5,15,5,15,5,15,5,15,5,15,5,15,5,15,5,15,5,15,5,15,6,16,7,17,8,18
540 DATA 9,19,10,20,11,21,12,22,13,23,14,24,15,25,16,26,17,27,18,28,19,29,20,30,21,31,22,32,23,33,24,34,25,35
550 DATA 26,36,27,37,28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,1,1,1,1,28,38,28,38
560 DATA 28,38,28,38,28,38,28,38,28,38,28,38,28,38,28,38,27,37,5,37,5,37,5,37,5,37,5,37,15,37,15,37,15,37,15,37
570 DATA 15,37,15,37,15,37,15,37,15,37,15,37,15,37,15,30,15,30,15,30,15,30,15,30,15,30,15,30,15,24,15,24,15,24
580 DATA 15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24
590 DATA 3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24
600 DATA 3,24,3,24,3,24,3,15,3,15,3,15,3,15,3,15,3,15,3,15,3,15,3,15,4,16
605 DATA 5,17,6,18,7,19,8,20,9,21,10,22,11,23,12,24
610 DATA 13,25,14,26,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15
620 DATA 24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,24,15,20,15,20,15,20,15,20,15,17,15,17,15,17,15,17
630 DATA 15,18,14,19,13,20,12,21,11,22,10,23,9,24,8,25,7,26,6,27,5,28,4,29,3,30,2,31,1,32,0,33,0,34,0,35,0,36
640 DATA 0,37,0,38,0,38
650 COLOR 42:PLOT A,B
660 IF YY=0 THEN POKE 112+ST,0:POKE 112+ST+6,0
670 IF YY=1 THEN POKE 112+ST,255:POKE 112+ST+6,255
680 YY=YY+1:IF YY>1 THEN YY=0
690 COLOR 32:PLOT II,0:II=II-0.15
700 IF II<19 THEN GOTO 1310
710 IF SEC=1 THEN IF TY=0 THEN POKE 48+ST,85:POKE 48+ST+1,85:POKE 48+ST+6,85:POKE 48+ST+7,85
720 IF SEC=1 THEN IF TY=1 THEN POKE 48+ST,170:POKE 48+ST+1,170:POKE 48+ST+6,170:POKE 48+ST+7,170
730 IF SEC=1 THEN TY=TY+1:IF TY>1 THEN TY=0
740 IF SEC=1 THEN TM=TM+1:IF TM>500 THEN TM=0:SEC=0:GOTO 110
750 IF SEC=1 THEN GOTO 820
760 POSITION 19,1:? "{INS LINE}":LOCATE A,B,C:COLOR 42:PLOT A,B
770 READ AA:READ BB:COLOR 47:PLOT 0,1:DRAWTO AA,1:PLOT BB,1:DRAWTO 38,1
780 IF UU=0 THEN GG=INT(RND(1)*HH):IF GG=0 THEN UU=1:GOSUB 1020
790 IF UU=1 THEN VV=VV+1:IF VV>10 THEN VV=0:UU=0
800 WW=INT(RND(1)*15):IF WW=1 THEN GOSUB 990
810 IF SEC=0 THEN GOTO 830
820 TG=TG+1:IF TG>HH THEN POSITION 0,1:? "{INS LINE}":TG=0
830 TRAP 1600
840 SOUND 1,38,0,5
850 IF YY=1 THEN SOUND 0,93,10,8
860 POSITION 5,0:? SC
870 POKE 77,0
880 IF STRIG(0)=0 THEN GOSUB 1050
890 X=STICK(0):COLOR 32:PLOT A,B
900 IF X=7 OR X=5 THEN A=A+1
910 IF X=11 OR X=9 THEN A=A-1
920 IF SEC=0 THEN IF X=14 OR X=10 OR X=6 THEN GOSUB 1230
930 IF A<2 THEN A=2
940 IF A>38 THEN A=38
950 LOCATE A,B,D:IF C<>42 AND C<>32 AND C<>160 THEN GOTO 1350
960 IF D<>42 AND D<>32 AND D<>160 THEN GOTO 1350
970 SOUND 0,0,0,0
980 GOTO 650
990 XX=INT(RND(1)*BB):IF XX<AA+1 THEN XX=AA+1
1000 COLOR 45:PLOT XX,1
1010 RETURN
1020 COLOR 46:PLOT AA,1:DRAWTO BB,1
1030 EE=INT(RND(1)*BB-1):IF EE<AA+2 THEN EE=AA+2
1040 COLOR 41:PLOT EE-2,1:DRAWTO EE+2,1:RETURN
1050 LOCATE A,B-1,CC:IF CC<>32 AND CC<>160 THEN GOTO 1350
1060 COLOR 20:PLOT A,B-1:SOUND 0,20,0,15:FOR X=1 TO 3:NEXT X
1070 COLOR 40:PLOT A,B-1:SOUND 0,25,0,15:FOR X=1 TO 3:NEXT X
1080 COLOR 20:PLOT A,B-1:SOUND 0,20,0,10:FOR X=1 TO 3:NEXT X:COLOR 32:PLOT A,B-1
1090 FOR TB=B-2 TO 1 STEP -1:LOCATE A,TB,TC
1100 IF TC<>32 AND TC<>160 AND TC<>46 AND TC<>174 THEN GOTO 1130
1110 IF TC=46 OR TC=174 THEN GOTO 1210
1120 NEXT TB:SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN
1130 COLOR 20:PLOT A,TB:SOUND 0,35,0,15:FOR X=1 TO 3:NEXT X
1140 COLOR 40:PLOT A,TB:SOUND 0,40,0,15:FOR X=1 TO 3:NEXT X
1150 COLOR 20:PLOT A,TB:SOUND 0,35,0,10:FOR X=1 TO 3:NEXT X:COLOR 32:PLOT A,TB
1160 IF TC=41 THEN SC=SC+50
1170 IF TC=43 THEN SC=SC+100
1180 IF TC=45 THEN SC=SC+150:GOTO 1440
1190 IF TC=38 THEN SC=SC+500:HT=HT+1:IF HT>3 THEN GOTO 1470
1200 SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN
1210 FOR ZZ=15 TO 0 STEP -2:SOUND 0,121,10,ZZ:SOUND 1,123,10,ZZ:NEXT ZZ:SOUND 0,0,0,0:SOUND 1,0,0,0
1220 RETURN
1230 SOUND 1,0,0,0:SOUND 2,0,0,0:FOR ZZ=255 TO 0 STEP -10:SOUND 0,ZZ,0,15
1235 SETCOLOR 2,0,PEEK(53770):NEXT ZZ:SETCOLOR 1,0,0:SETCOLOR 2,0,14
1240 TRAP 1580:FOR ZZ=1 TO 10
1250 POSITION 19,1:? "{INS LINE}":COLOR 42:PLOT A,B:READ AA:READ BB:COLOR 47:PLOT 0,1:DRAWTO AA,1:PLOT BB,1:DRAWTO 38,1
1260 IF UU=0 THEN GG=INT(RND(1)*HH):IF GG=0 THEN UU=1:GOSUB 1020
1270 COLOR 32:PLOT II,0:II=II-0.5:WW=INT(RND(1)*25):IF WW=1 THEN GOSUB 990
1280 IF II<19 THEN GOTO 1310
1290 NEXT ZZ:FOR ZZ=0 TO 255 STEP 10:SOUND 0,ZZ,0,15
1295 SETCOLOR 2,0,PEEK(53770):NEXT ZZ:SETCOLOR 2,0,0:SETCOLOR 1,0,10
1300 SOUND 0,0,0,0:RETURN
1310 SEC=0:SOUND 1,0,0,0:SOUND 2,0,0,0:FOR ZZ=1 TO 5
1320 POSITION 15,10:? "OUT OF FUEL!":SOUND 0,40,10,15:FOR X=1 TO 60:NEXT X
1330 POSITION 15,10:? "            ":SOUND 0,0,0,0:FOR X=1 TO 60:NEXT X
1340 NEXT ZZ:GOTO 1350
1350 SETCOLOR 1,0,10:SOUND 1,0,0,0:SOUND 2,0,0,0:FOR ZZ=15 TO 5 STEP -0.25
1355 SOUND 0,20,0,ZZ:SETCOLOR 2,0,PEEK(53770):NEXT ZZ
1360 SEC=0:SETCOLOR 2,0,0:COLOR 39:PLOT A,B:SOUND 0,20,0,15:FOR X=1 TO 10:NEXT X
1370 COLOR 39:PLOT A-1,B-1:PLOT A+1,B-1:PLOT A-1,B:PLOT A+1,B:SOUND 0,25,0,15:FOR X=1 TO 10:NEXT X
1380 COLOR 39:PLOT A-2,B-2:PLOT A+2,B-2:PLOT A-2,B:PLOT A+2,B:SOUND 0,20,0,15:FOR X=1 TO 10:NEXT X
1390 COLOR 39:PLOT A-3,B-3:PLOT A+3,B-3:PLOT A-3,B:PLOT A+3,B:SOUND 0,20,0,15:FOR X=1 TO 10:NEXT X
1400 COLOR 39:PLOT A-4,B-4:PLOT A+4,B-4:PLOT A-4,B:PLOT A+4,B:SOUND 0,20,0,15:FOR X=1 TO 10:NEXT X
1410 SOUND 0,0,0,0:SOUND 1,0,0,0:FOR X=1 TO 200:NEXT X
1420 FOR ZZ=1 TO 25:POSITION 0,1:? "{INS LINE}":NEXT ZZ
1430 SH=SH-1:GOTO 110
1440 SOUND 1,0,0,0:FOR ZZ=II TO II+5:IF ZZ>38 THEN GOTO 1460
1450 COLOR 44:PLOT ZZ,0:SOUND 0,ZZ,10,10:FOR X=1 TO 2:NEXT X:SOUND 0,0,0,0:NEXT ZZ
1460 II=ZZ-1:SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN
1470 SOUND 2,0,0,0:FOR ZZ=1 TO 20
1480 SETCOLOR 2,0,PEEK(53770):FOR XX=0 TO 255 STEP 20:SOUND 0,XX,10,15:SOUND 1,XX+2,10,15:NEXT XX
1490 NEXT ZZ
1500 FOR QQ=1 TO 5
1510 FOR ZZ=15 TO 0 STEP -0.5:SOUND 0,20,0,ZZ:SETCOLOR 2,0,ZZ:SETCOLOR 1,0,ZZ:NEXT ZZ
1520 NEXT QQ
1530 ? "{CLEAR}":SETCOLOR 1,0,10:COLOR 42:PLOT A,B:SOUND 0,0,0,0:SOUND 1,0,0,0
1540 POSITION 2,5:? "BASE DESTROYED!!! BONUS 5000 POINTS"
1550 SC=SC+5000:FOR X=1 TO 500:NEXT X
1560 HH=HH-2:IF HH<2 THEN HH=2
1570 SEC=0:GOTO 110
1580 FOR ZZ=0 TO 255 STEP 5:SOUND 0,ZZ,0,15:SETCOLOR 2,0,PEEK(53770):NEXT ZZ:SETCOLOR 2,0,0:SETCOLOR 1,0,10
1590 SOUND 0,0,0,0:GOTO 1600
1600 SOUND 1,0,0,0:SOUND 2,0,0,0
1610 COLOR 42:PLOT A,B:SOUND 0,0,0,0:POSITION 14,10:? "YOU ESCAPED!!"
1620 FOR X=1 TO 200:NEXT X
1630 POSITION 5,10:? "PREPARE TO BATTLE THE BASE!!!":FOR X=1 TO 200:NEXT X
1640 POSITION 5,10:? "DESTROY EACH GLOWING REACTOR TO"
1650 FOR X=1 TO 200:NEXT X
1660 POSITION 2,10:? "DESTROY THE MOTHER SHIP. GOOD LUCK!":FOR X=1 TO 500:NEXT X
1670 SEC=1:GOTO 110
1680 POSITION 15,10:? "GAME OVER":SETCOLOR 2,0,0:SETCOLOR 1,0,10
1685 SOUND 0,0,0,0:SOUND 1,0,0,0:SOUND 2,0,0,0:SOUND 3,0,0,0
1690 IF PEEK(53279)=6 THEN GOTO 50
1700 GOTO 1690
1710 POKE 16,64:POKE 53774,3:RETURN

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: CENTURON.BAS.

Credits