Fallout

Type
Game
Category
Dodge-and-catch game
Author
Scott McKissock
Published in
The Best of Antic, Volume 1 (Antic Publishing), one of the book's new games
Language
Atari BASIC
Requirements
Joystick in port 1, Atari BASIC; 32K or more RAM recommended (the book lists 16K)
A black GRAPHICS 1 screen with green monster faces, blue diamonds and a small pink baby falling toward an orange man at the bottom, with SCORE 3 in the corner

About the program

Fallout was one of the six brand-new games in The Best of Antic, Volume 1, and the book gave it the subtitle "a cycle of birth, labor, and goodbye". You are a little man at the bottom of the screen facing a curtain of falling objects. Pink babies give you an extra life, blue diamonds are worth points, and green monsters take a life away. You start with three lives.

Each wave is a level. Diamonds are worth one point in the first wave, two in the second, and so on up to ten. At the end of a wave you get a bonus of the level number for each life you have left. As the levels go by, the objects fall faster and at changing angles.

What you need

A joystick in port 1. The book says 16K, but the program moves the top of memory down 16 pages and builds a 4K playfield plus a character set. A 32K or larger machine is the safe choice.

Typing it in

Inverse-video text is marked {inv}…{/inv}. Type it with the Atari key on, then turn it off again. The REMs at the ends of lines explain each step and can be left out. Lines 100–240 depend on their exact line numbers. Line 115 does GOTO 120+(20*COL), using the collision value to pick a handler, so don't renumber this part.

How to play

After RUN, the title screen asks you to wait about 55 seconds while the playfield is built. Then press START. Move left and right with the joystick. The screen wraps at the edges.

How it works

  • Lines 500–720 lower RAMTOP (location 106) by 16 pages and fill the 4K below it with randomly placed objects, POKEd straight into memory as character codes. Three redefined characters (lines 600–620) are the baby, the monster and the diamond. The top two bits of each code choose its colour register (codes 1, 66 and 131), and that colour is also what the collision register reports.
  • Nothing is redrawn while you play. The objects "fall" because line 65 subtracts about 20 bytes, one GRAPHICS 1 row, from the LMS address in the display list (DL and DL+1), so ANTIC starts reading the playfield one row earlier. Line 50 alternates the step between 19 and 21 bytes on later levels, which makes everything drift sideways too.
  • Lines 900–910 add a separate LMS line at the top of the display list, so the score line stays still while the field scrolls.
  • The man is player 0. PEEK(53252) tells which playfield colour he touched, and line 115 jumps to the right routine.

Listing

1 REM ******** FALLOUT ********
2 REM BY SCOTT MCKISSOCK
10 GOTO 400
49 REM MAIN LOOP
50 D=20+DR:DR=-DR:NS=INT(RND(0)*10)+SN:FOR SC=1 TO NS:FOR T=1 TO FN:NEXT T
62 S=STICK(0):M=(S=7)*8-(S=11)*8:IF M=0 THEN 65
63 X=X+M:POKE 53248,X:SOUND 0,255,10,8:IF PEEK(53252) THEN COL=PEEK(53252):GOTO 100
65 LB=LB-D:IF LB<0 THEN LB=LB+256:HB=HB-1:POKE 559,0:POKE DL,LB:POKE DL+1,HB:POKE 559,46
70 SOUND 0,0,0,0:POKE DL,LB:IF HB=P106-1 THEN POKE 559,0:POKE DL+1,HB-1:POKE DL,248:POKE 559,46:GOTO 300
71 IF PEEK(53252) THEN COL=PEEK(53252):GOTO 100
72 OK=0:S=STICK(0):M=(S=7)*8-(S=11)*8:X=X+M:IF M=0 THEN 77
74 IF X>=200 THEN X=56
75 IF X<=48 THEN X=192
76 POKE 53248,X
77 IF PEEK(53252) THEN COL=PEEK(53252):GOTO 100
80 NEXT SC:GOTO 50
100 SOUND 0,99,1,14:IF OK=1 THEN FOR T=1 TO 30:NEXT T:POKE 53278,0:NEXT SC:GOTO 50
110 OK=1:POKE 53278,0:REM CLEAR COLISION REGISTER
115 GOTO 120+(20*COL):REM COL=VALUE IN COLISION REGISTER 0
140 FOR T=15 TO 0 STEP -0.75:POKE 712,T*16:SOUND 0,T*16,10,16-T:NEXT T:SOUND 0,0,0,0
145 LIVES=LIVES+1-(LIVES=6):POKE (P106-4)*256+10+LIVES,1
150 NEXT SC:GOTO 50
160 FOR T=255 TO 5 STEP -5:POKE 704,T:SOUND 0,T,2,15:NEXT T:SOUND 0,0,0,0:POKE 704,24
165 LIVES=LIVES-1:POKE (P106-4)*256+11+LIVES,0
170 IF LIVES=0 THEN 250
175 NEXT SC:GOTO 50
180 GOTO 160
200 FOR T=-125 TO 125 STEP 10:POKE 710,ABS(T):SOUND 0,ABS(T),10,15:NEXT T:SOUND 0,0,0,0:POKE 710,148
205 AD=AD+1-(AD=10):SCORE=SCORE+AD:POSITION 7,0:? #6;SCORE
210 POKE 53248,X:NEXT SC:GOTO 50
220 GOTO 140
240 GOTO 160
250 POKE 87,1:POKE 89,P106-1:POSITION 10,7:? #6;"       {inv}game over{/inv}      "
255 POSITION 10,10:? #6;"      {inv}PRESS START{/inv}   "
257 POKE 559,0:POKE DL+1,P106-2:POKE DL,248:POKE 559,46:REM DISPLAY "GAME OVER"
260 POKE DL+26,P106-5:FOR T=255 TO 252 STEP -1:POKE DL+25,T:FOR Y=1 TO 20:NEXT Y:NEXT T:REM SCROLL SCORE
280 IF PEEK(53279)<>6 THEN 280:REM CHECK FOR START
285 SCORE=0:LIVES=3:LV=0:POKE DL+25,0:POKE DL+26,P106-4:REM LINE UP SCORE
290 POKE 88,0:POKE 89,P106-4:POSITION 0,0:? #6;" {inv}score{/inv} ";SCORE;"    !!    ":GOTO 305
300 FOR T=1 TO 500:NEXT T:POKE 77,0
305 LV=LV+1:FN=60-(4*LV)-(LV=1)*60:DR=1-(LV=1):SN=INT(12-LV*0.5):IF SN<0 THEN SN=0
365 IF LV=1 THEN 385:REM NO BONUS IF GAME JUST STARTED
370 FOR BNS=1 TO LIVES:SOUND 0,100-BNS*5,10,10:SCORE=SCORE+LV-1:POSITION 7,0:? #6;SCORE:SOUND 1,90-BNS*5,10,10
375 FOR DLY=1 TO 50:NEXT DLY:SOUND 0,0,0,0:SOUND 1,0,0,0
380 FOR DLY=1 TO 50:NEXT DLY:NEXT BNS
385 LB=216:HB=P106+15:POKE 559,0:POKE DL,LB:POKE DL+1,HB:POKE 559,46
390 POKE 87,1:POKE 559,0:POKE 89,P106-1:POSITION 14,7:? #6;"{inv}level{/inv} ";LV;" {inv}complete{/inv}":AD=0:POKE 559,46
395 POSITION 14,10:? #6;"{inv}NOW{/inv} {inv}ADDING{/inv} {inv}BONUS{/inv} ":POKE 88,0:POKE 89,P106-4:OK=1:GOTO 50
400 GRAPHICS 17:POSITION 6,8:? #6;"Fa{inv}l{/inv}Lo{inv}u{/inv}T"
410 POSITION 4,12:? #6;"{inv}PLEASE{/inv} {inv}WAIT{/inv}"
420 POSITION 4,14:? #6;"{inv}55{/inv}  {inv}SECONDS{/inv}"
430 FOR R=1 TO 100
450 Z=PEEK(711):POKE 711,PEEK(709):POKE 709,PEEK(708):POKE 708,Z:REM ROTATE COLORS
460 N=PEEK(53770):FOR T=4 TO 10:SOUND 0,N,T,15:NEXT T:NEXT R:SOUND 0,0,0,0:REM RANDOM TONE
500 POKE 559,0:P106=PEEK(106)-16:FOR T=(P106-2)*256 TO (P106+16)*256:POKE T,0:NEXT T:REM CLEAR MEMORY
505 POKE 106,P106:REM MOVE RAMTOP DOWN 16 PAGES
510 CHSET=(PEEK(106)-8)*256:FOR I=0 TO 512:POKE CHSET+I,PEEK(57344+I):NEXT I:REM MOVE CHARACHTER SET INTO RAM
525 CSETP=CHSET/256:READ CHTR:IF CHTR=-1 THEN GOTO 700
530 FOR I=CHTR*8 TO CHTR*8+7:READ A:POKE CHSET+I,A:NEXT I:GOTO 525:REM DRAW CHARACHTER SHAPES
600 DATA 1,12,12,0,15,28,44,10,9
610 DATA 2,14,21,31,17,14,10,27,0
620 DATA 3,14,17,17,10,10,4,4,0,-1
699 REM PUT SHAPES IN MEMORY
700 FOR I=(P106+16)*256 TO (P106*256)+460 STEP -3:D=RND(0):IF D<0.9 THEN NEXT I:GOTO 800
710 IF D>0.99 THEN POKE I,1:BB=BB+1:NEXT I:GOTO 800
715 IF D>0.96 THEN POKE I,131:NEXT I:GOTO 800
720 POKE I,66:NEXT I
799 REM SET UP P/M GRAPHICS
800 PBP=P106-16:POKE 54279,PBP:PMBASE=PBP*256:X=120:Y=92
810 POKE 53277,3:POKE 704,216
820 FOR I=PMBASE+512+Y TO PMBASE+526+Y:READ A:POKE I,A:NEXT I:POKE 53248,X
870 DATA 24,24,24,0,60,90,90,90,24,24,36,36,36,36,102
899 REM PUT IN DISPLAY LIST
900 GRAPHICS 17:POKE 559,46:POKE 756,CHSET/256:DL=PEEK(560)+256*PEEK(561)+4:POKE DL+24,70:POKE DL+25,0
910 POKE DL+26,P106-4:POKE DL+27,65:LB=PEEK(DL):HB=PEEK(DL+1):POKE 88,0:POKE 89,P106-4
920 POKE 88,0:POKE 89,P106-4:GOTO 285

Download

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

Credits