Bomb Run I (Revision 1) Written by mjhayes@cs.buffalo.edu June 29, 1998 This program uses the graphics from "Advanced Dungeons & Dragons: Cloudy Mountain." It was written as an example program for the Summer 1998 ECS BASIC programming contest. See the contest rules on my web page, The Intellivision Library. http://www.cs.buffalo.edu/~mjhayes Revision 1 fixes an error in a single line of code the made the water the same color as the sky. Yes, the water should be blue. The object of the game is to bomb underwater targets as your watercraft passes over them. Use the disc to move the craft back and forth along the surface, and any action button to drop a bomb. Be careful not to drop bombs wastefully, because points are deducted for missing. Each target is a little lower than the last. After the last target passes by, the final score appears on the screen. Try again to beat your best score. 10 CLR 20 FM(1)=0 ; One number will be displayed on a line, in regular notation, with 0 places to the right of the decimal point. 30 FM(4)=4 ; Display the text in dark green. 40 PRIN"BOMB RUN I" 50 PRIN"BY MIKE HAYES" 60 PRIN"DOLM: 8/28/1998 " ; Display credits. 70 PRIN"PRESS ANY ACTION" 80 PRIN"BUTTON TO CONTINUE." 90 CALL HAND 100 IF(A=0)GOTO 90 ; Wait for an action key to be pressed. 110 FOR A=80 TO 239 120 BK(A)=1 ; Draw the water. 130 NEXT A 140 DATA 0,7,0,0 150 READ D,N,M,O 160 CALL GRAB ; Create the boat -- er -- watercraft. 170 CO(0)=11 ; Make it brown. 180 XS(0)=1 ; Make it wide too. 190 N=40 200 O=1 210 CALL GRAB ; Create the bomb. 220 VS(1)=-1 230 N=43 240 M=1 250 O=2 260 CALL GRAB ; Create the target. 270 CO(2)=2 ; Make it red. 280 XS(2)=1 ; Make it wide too. 290 SQ(2)=9 ; Give it animation. 300 FOR A=0 TO 79 310 BK(A)=9 ; Draw the sky. 320 NEXT A 330 C=0 340 P=0 350 L=1 360 E=14 370 CALL ENVN ; Make the watercraft's engine audible. 380 E=0 390 L=9999 400 N=2 ; Values M and N are set, preparing for collision detection. 410 I=0 ; Reset the score. 420 FOR B=42 TO 96 ; Main loop{ 430 XP(2)=168 440 YP(2)=B ; Put the target into position. 450 VS(2)=1 ; Make it visible. 460 F=RN(0) ; Generate a counter which will eventually release the next target. 470 IF(F>99)XV(2)=-49 ; Release the target if the time has come. 480 YP(0)=(RN(0)/34)+32 ; Make the watercraft bounce off the waves. 490 CALL HAND ; Poll the left hand controller. 500 XV(0)=0 510 IF(H=-9)XV(0)=-99 ; Was the disc pressed to the left? 520 IF(H=-1)XV(0)=99 ; Was the disc pressed to the right? 530 IF(A=0)GOTO 630 ; Was an action button pressed? 540 I=I-9 ; Points are deducted for dropping a bomb. More points are earned back if the target is hit. 550 IF(VS(1)=1)GOTO 640 ; Only one bomb can drop at a time. 560 C=3 570 P=9 580 CALL ENVN ; Make a sound. 590 XP(1)=XP(0) 600 YP(1)=32 ; Put the bomb into position. 610 YV(1)=79 ; Drop the bomb. 620 VS(1)=1 ; Make the bomb visible. 630 IF(VS(1)=-1)GOTO 730 ; Is the bomb still visible? If it is{ 640 CALL DIST ; Check the distance between the bomb and the target. 650 IF(D>15)GOTO 720 ; Was the target hit? If it was{ 660 C=4 670 P=0 680 CALL ENVN ; Make a sound. 690 VS(1)=-1 ; Make the bomb invisible. 700 VS(2)=-1 ; Make the target invisible. 710 I=I+B ; Score points, more for lower targets.} 720 XV(1)=19-YP(1) ; Adjust the velocity of the bomb; it slows down as it loses momentum.} 730 F=F+9 ; Update the counter. 740 IF(YP(1)>90)VS(1)=-1 ; Has the bomb disappeared? 750 IF(XP(2)>16)GOTO 470 ; Check the counter again. 760 XV(2)=0 ; Stop the target. 770 NEXT B ; } 780 FOR O=0 TO 2 790 VS(O)=-1 ; Make all sprites disappear for a moment. 800 NEXT O 810 CALL HUSH 820 PRIN"YOUR SCORE IS",I 830 PRIN"PRESS ANY ACTION" 840 PRIN"KEY TO PLAY AGAIN." 850 CALL HAND 860 IF(A=0)GOTO 850 ; Wait until action key is pressed. 870 VS(0)=1 ; Make the watercraft visible. 880 VS(2)=1 ; Make the target visible. 890 GOTO 300 ; Play again.