ROM Computer Magazine Archive ROM MAGAZINE ISSUE 5 — APRIL/MAY 1984 / PAGE 34

WATER FROM HEAVEN
By PETER ELLISON

    Deep inside darkest Africa there lives a tribe called the Moegabians and for centuries have kept an ancient custom. The cuscalled "Moneg-ehds-sayalk" or in English "Water From Heaven." Every year, just before harvest, each tribe member would wait outside his or her mud hut with a strainer waiting for the rains to come. When the rains begin, the entire tribe would huddle together around the farmland, strainers in hand, and begin moving back and forth to catch the raindrops. The reason for this was, if the rain touched the ground without first going through the strainer, the piece of ground would become unholy, and the ground was their livelihood. For this reason something had to be sacrificed inorder to appease the gods. But if this rain called "moguna" or "Heaven Rain" was strained and landed on the ground, the ground would be blessed from heaven,giving a fruitful harvest.This meant that the tribe had to move quickly back and forth as one unit, so that no rain would fall without first being strained.
    The story that you just read in the beginning paragraph is a short outline of this game. This game, called "Water From Heaven", is one in which you move your strainer back and forth, inorder to catch the raindrops that fall from the top of the screen. If you catch the drop and it passes through your strainer and hits the ground, you then receive some points. If you don't strain the rain and it hits the ground, then you lose one life. Sometimes you will have to hold the strainer in one position to get the drop or you'll lose a life.
    This game is written in BASIC with a short little assembly language suroutine to move the raindrops down the screen quickly and smoothly. This game demonstrates the potential your ATARI computer has in BASIC to produce arcade-type action. The game was written in graphics mode three because this was the fastest graphics mode for the Player/missile graphics. I used Player(0) for the strainer and Players(1-3) for the raindrops. All of the raindrop's shapes were setup in the assembly language subroutine, so none of them had to be declared in BASIC. To begin with, the prowill ask you how many Lives(Up to nine) and Level(1-7). The difference in the levels, is the speed in which the raindrops fall. The machine-code takes a couple of seconds to load in at the beginning of the game.
    All that is needed to play the game is that you type in the BASIC listing. The Assembly language listing is just so those people who want to see how the players(raindrops) were moved down the screen. There are really two short Assembly language subroutines for this program, but I have only listed one. The reason for this is the only difference between the two is what I made VPOS equal to. In the one not listed, VPOS is equal to $652 instead of $601. This subroutine had to be different for a 16K machine and a 48K computer. This is because PMBASE is different with the amount of memory your machine has. This is the reason for the two different DATA listings. If you have 48K then type in the DATA statements that are at the end of the 16K listing.
    I hope you enjoy this game and if you have any modifications or suggestions, feel free to send them in. Have fun, and don't forget to strain the water.

10 REM WATER FROM HEAVEN
20 REM ROM MAGAZINE 1984
30 REM REQUIRES 16K AND ONE JOYSTICK
40 GOTO 120
50 REM READ DATA FOR MUSIC
60 READ A
70 IF A=31 THEN GOTO 180
80 SOUND 0,A,10,10:SOUND 1,243,10,6:SOUND 2,204,10,6:SOUND 3,173,10,6
90 FOR Z=1 TO 90:NEXT Z
100 GOTO 60
110 DATA 96,81,60,81,96,81,121,31
120 GRAPHICS 2+16
130 POSITION 2,2
140 ? #6;"WATER from "
150 POSITION 2,4:? #6;"BY Peter Ellison"
160 POSITION 0,6:? #6;"(c)ROM Magazine 1984"
170 GOSUB 60
180 C=PEEK(53279)
190 SOUND 0,0,0,0:SOUND 1,0,0,0:SOUND 2,0,0,0:SOUND 3,0,0,0
200 IF C=6 THEN GOTO 240
210 LIV=1:SCORE=0:LEV=1:SC=0
220 POSITION 0,8:?    #6;"PRESS START TO BEGIN"
230 GOTO 180
240 ? #6;clear screen
250 P=PEEK(53279)
260 IF P=5 THEN LIV=LIV+1:IF LIV>=10 THEN LIV=1
270 IF P=3 THEN LEV=LEV+1:IF LEV>7 THEN LEV=1
274 IF LEV=2 THEN NUM=10:IF LEV=3 THEN NUM=20:IF LEV=4 THEN NUM=30:IF LEV=5 THEN NUM=40:IF LEV=6 THEN NUM=50
276 IF LEV=7 THEN NUM=60
280 IF STRIG(0)=0 THEN GOTO 350
290 POSITION 2,4:? #6;"lives:";LIV
300 POSITION 2,6:? #6;"";LEV
310 POSITION 0,8:? #6;"press select for lives"
320 POSITION 0,9:? #6;"PRESS OPTION FOR LEVEL"
330 POSITION 0,10:? #6;"TO BEGIN PRESS BUTTON"
340 GOTO 250
350 POKE 752,1
360 SCORE=0
370 A=1:B=5:C=12:D=11
380 REM START GAME
390 GRAPHICS 3
400 COLOR 2
410 SETCOLOR 2,16,1
420 ? "*************************************"
430 ? "                                     "
450 POKE 712,40:POKE 708,35
460 REM SET UP PLAYER/MISSILE AREA
470 POKE 53256,1
480 POKE 623,1
490 I=PEEK(106)-8
500 POKE 53277,3:POKE 54279,1
510 PMBAS=I*256
520 POKE 704,72:POKE 705,150:POKE 706,100:POKE 707,22
530 POKE 559,46
540 REM RAIN DROPS
550 X1=160:Y1=20
560 POKE 53249,X1
570 X2=100:Y2=20
580 POKE 53250,X2
590 X3=145:Y3=150
600 POKE 53251,X3
610 M=100:Y=92
620 REM DROP STRAINER
630 POKE 53248,M
640 FOR L=PMBAS+512 TO PMBAS+640:POKE L+X,0:NEXT L
650 FOR L=1 TO 8
660 READ G
670 POKE PMBAS+512+Y+L,G
680 NEXT L
690 DATA 255,255,126,126,60,60,60,126
700 GOTO 990
710 REM CLEAR COLLISIONS
720 POKE 53278,0
730 REM MAIN GAME LOOP
740 ST=STICK(0)
744 REM POINTS PER LEVEL
745 IF LEV=1 THEN PO=1
746 IF LEV=2 THEN PO=2
747 IF LEV=3 THEN PO=3
748 IF LEV=4 THEN PO=4
749 IF LEV=5 THEN PO=5
750 IF LEV=6 THEN PO=6
751 IF LEV=7 THEN PO=7
755 X=USR(1538):X=USR(1638)
760 REM COLLISIONS:POKE 53278,0
770 IF PEEK(53260)<1 AND PEEK(53253)>1 THEN GOSUB 1110:POKE 53249,K:X=USR(1538):LIV=LIV-1
780 IF PEEK(53260)<1 AND PEEK(53254)>1 THEN GOSUB 1110:POKE 53250,L:X=USR(1538):LIV=LIV-1
790 IF PEEK(53260)<1 AND PEEK(53255)>1 THEN GOSUB 1110:POKE 53251,0:X=USR(1638):LIV=LIV-1
800 IF LIV=0 THEN GOTO 1230
810 POKE 752,1
820 POKE 1544,LEV+1:POKE 1644,LEV
830 IF PEEK(53260)>1 THEN SOUND A,B,C,D:SC=SC+PO
835 REM DETERMINE LEVEL
840 IF PEEK(53260)>1 THEN NUM=NUM +1
850 IF NUM=10 THEN LEV=2:IF NUM=20 THEN LEV=3:IF NUM=30 THEN LEV=4:IF NUM=40 THEN LEV=5:IF NUM=50 THEN LEV=6
860 IF NUM=60 THEN LEV=7
870 ? ↑↑:? "SCORE:";SC
880 POKE 85,1
890 IF ST=11 OR ST=10 OR ST=9 THEN M=M-8:POKE 53248,M
900 IF ST=7 OR ST=6 OR ST=5 THEN M=M+8:POKE 53248,M
910 IF M<=85 THEN M=190
920 IF M>=191 THEN M=86
930 X=USR(1538)
940 X=USR(1638)
950 POKE 53278,0
960 SOUND 1,0,0,0
970 SOUND 0,0,0,0
980 GOTO 720
990 FOR R=1 TO 80:READ S:POKE 1538+R-1,S:NEXT R
1000 DATA 104,173,82,6,24,105,1,141,82,6,172,82,6,169,0,153,120,58,153,121,58,153,122,58
1010 DATA 153,123,58,153,124,58,153,125,58,153,126,58,153,127,58,169,4,153,128,58,1.69,4,153,129
1020 DATA 58,169,4,153,130,58,169,4,153,131,58,169,14,153,132,58,169,31,153,133,58,169,14,153
1030 DATA 134,58,169,4,153,135,58,96
1040 FOR H=1 TO 80:READ K:POKE 1638+H-1,K:NEXT H
1050 DATA 104,173,1,6,24,105,1,141,1,6,172,1,6,169,0,153,248,58,153,249,58,153,250,58
1060 DATA 153,251,58,153,252,58,153,253,58,153,254,58,153,255,58,169,4,153,0,59,169,4,153,1
1070 DATA 59,169,4,153,2,59,169,4,153,3,59,169,14,153,4,59,169,31,153,5,59,169,14,153
1080 DATA 6,59,169,4,153,7,59,96
1090 GOTO 720
1100 REM COLLISION SUBROUTINE
1110 POKE 712,PEEK(53770)
1120 Q=Q+1
1130 FOR X=10 TO 20:SOUND 0,X,6,10:SOUND 1,X,8,8:SOUND 2,X,10,12:NEXT X
1140 SOUND 1,0,0,0:SOUND 2,0,0,0
1150 IF Q>3 THEN GOTO 1170
1160 GOTO 1110
1170 Q=0
1180 X=USR(1538):X=USR(1638):POKE 712,40
1190 K=INT(RND(0)*100)+50:IF K<90 THEN K=90
1200 L=INT(RND(0)*140)+50:IF L<120 THEN L=120
1210 O=INT(RND(0)*140)+50:IF O<120 THEN O=120
1220 RETURN
1230 REM GAME OVER
1240 REM ENDING SONG
1250 GOSUB 1410
1260 READ A
1270 IF A=31 THEN END
1280 SOUND 0,A,10,10:SOUND 1,243,10,6:FOR W=1 TO 400 STEP 20:NEXT W
1290 GOTO 1490
1300 END
1310 DATA 121,121,121,102,108,108,121,121,128,121,162
1320 DATA 60,60,60,50,53,53,60,60,64,81
1330 DATA 121,121,121,102,108,108,121,121,128,121,162
1340 DATA 60,60,60,50,53,53,60,60,64,81
1350 DATA 121,121,121,102,108,108,121,121,128,121,162
1360 DATA 60,60,60,50,53,53,60,60,64,81
1370 DATA 121,121,121,102,108,108,121,121,128,121,162
1380 DATA 60,60,60,50,53,53,60,60,64,81
1390 DATA 121,121,121,102,108,108,121,121,128,121,162
1400 DATA 60,60,60,50,53,.53,60,60,64,81,29,29,29,31
1410 PLOT 12,5:DRAWTO 9,5:DRAWTO 9,10:DRAWTO 12,10:DRAWTO 12,8:DRAWTO 11,8
1420 PLOT 17,10:DRAWTO 17,5:DRAWTO 14,5:DRAWTO 14,10:PLOT 16,7:DRAWTO 15,7
1430 PLOT 23,10:DRAWTO 23,5:DRAWTO 21,7:DRAWTO 19,5:DRAWTO 19,10
1440 PLOT 28,10:DRAWTO 25,10:DRAWTO 25,5:DRAWTO 28,5:PLOT 26,7:DRAWTO 28,7
1450 PLOT 9,13:DRAWTO 9,18:DRAWTO 12,18:DRAWTO 12,13:DRAWTO 9,13
1460 PLOT 14,13:DRAWTO 16,18:DRAWTO 18,13
1470 PLOT 23,18:DRAWTO 20,18:DRAWTO 20,13:DRAWTO 23,13:PLOT 21,15:DRAWTO 23,15
1480 PLOT 26,15:DRAWTO 28,15:DRAWTO 28,13:DRAWTO 25,13:DRAWTO 25,18:PLOT 29,18:DRAWTO 26,16
1490 POKE 712,PEEK(53770):GOSUB 1260

    These lines below are to be type in instead, if your machine has 48K:

990 FOR R=1 TO 80:READ S:POKE 1538+R-1,S:NEXT R
1000 DATA 104,173,1,6,24,105,0,141,1,6,172,1,6,169,0,153,120,155,153,121,155,153,122,155
1010 DATA 153,123,155,153,124,155,153,125,155,153,126,155,153,127,155,169,4,153,128,155,169,4,153,129
1020 DATA 155,169,4,153,130,155,169,4,153,131,155,169,14,153,132,155,169,31,153,133,155,169,14,153
1030 DATA 134,155,169,4,153,135,155,96
1040 FOR H=1 TO 80:READ K:POKE 1638+H-1,K:NEXT H
1050 DATA 104,173,82,6,24,105,0,141,82,6,172,82,6,169,0,153,120,154,153,121,154,153,122,154
1060 DATA 153,123,154,153,124,154,153,125,154,153,126,154,153,127,154,169,4,153,128,154,169,4,153,129
1070 DATA 154,169,4,153,130,154,169,4,153,131,154,169,14,153,132,154,169,31,153,133,154,169,14 ,153
1080 DATA 134,154,169,4,153,135,154,96

00005  *ASSEMBLER SUBROUTINE FOR*
00006  *MOVING RAINDROPS DOWN THE*
00007  *SCREEN*
00010  .LI OFF
00020  .OR $84D0
00030  .TA $2600
00035  *TARGET ADDRESS
00040  .TF "D:DROP.PL1"
00045  *VPOS IS $601 OR $652*
00046  *DEPENDING ON WHICH PLAYER*
00050 VPOS     .EQ $601
00055  *PLAYER MISSILE BASE ADDRESS
00060 PMBASE   .EQ $3800
00070    PLA
00080    LDA VPOS
00090    CLC
00100    ADC #1
00110    STA VPOS
00120    LDY VPOS
00130    LDA #0
00150    STA PMBASE+$278,Y
00160    STA PMBASE+$279,Y
00170    STA PMBASE+$27A,Y
00180    STA PMBASE+$27B,Y
00190    STA PMBASE+$27C,Y
00200    STA PMBASE+$27D,Y
00210    STA PMBASE+$27E,Y
00220    STA PMBASE+$27F,Y
00225 *LOAD IN PLAYER DATA*
00230    LDA #4
00240    STA PMBASE+$280,Y
00270    LDA #4
00280    STA PMBASE+$281,Y
00290    LDA #4
00300    STA PMBASE+$282,Y
00310    LDA #4
00320    STA PMBASE+$283,Y
00330    LDA #14
00340    STA PMBASE+$284,Y
00350    LDA #31
00360    STA PMBASE+$285,Y
00370    LDA #14
00380    STA PMBASE+$286,Y
00390    LDA #4
00400    STA PMBASE+$287,Y
00410    RTS


Screen Shot