'===========================================================================
' Subject: Shooting Targets                   Date: 07-15-01 (  :  )       
'  Author: Richard Kelly                      Code: PB, QB, firstbasic     
'  Origin: newson@37.com                    Packet: GAMES.ABC
'===========================================================================
'Program: Shooting Targets
'Author: Richard Kelly (Newson@37.com)
'Category: Games
'Date of release: 07/15/01
'
'Runs in QB v1.1-v7.0, PowerBASIC, or FirstBASIC.
'
'This is based on a watch game I saw from the 1980s, only the cannons on the
'watch game shot diagonally.  Having the "cannon balls" shoot straight up was
'obviously the easy way to port the game, and I'm working on a higher-
'resolution version of the same game.  I hope to release the new version
'this year.
'
'This "low-res version" has a lot of mistakes I made when starting out in CGA
'mode.  I've since moved on to EGA modes, copying and pasting the changes on
'the "invisible screen" to the screen seen by the player.  What is *not*
'corrected is my making several different loops to draw and move the saucers
'when I could have simply assigned a few variables and initiated a few arrays,
'thus having one saucer routine instead of several.  If I did this same exact
'game today, it would probably be half the size it is right now, and would
'run a bit more smoothly on slower computers.  Oh, well ...
'
'FirstBASIC is recommended for this game but not required.
'
'GOSUB 109 simply changes the color of one of the stars.
'
'GS refers to the game speed, which can be increased or decreased.
'
'I don't completely understand some of this code anymore, so many variables
'will remain a mystery in this documentation.
'
'GOSUB 90 changes the AN and NA variables which are used to animate the saucer
'      image.
'
'The actual program begins on Line 13, but I had to put the DIM statements
'    in Line 1 to avoid compiler complaints about the array.
'
1 DIM S(99, 1), SA$(3), A%(81), B%(625), C%(13), D%(81): CLS : GOTO 13
'All saucer drawing routines hit the following lines in the FOR/NEXT loops.
'    I put this part in here to rid the program of redundancy.  The program
'    ended up with redundancy regardless.
2 B0 = BX: B1 = BY: SG = GS * .01: T2 = B0: T3 = B1: GOSUB 109: SOUND 32767, SG: PLAY "MN"
3 A$ = INKEY$: IF A$ = CHR$(0) + "K" AND BX = 0 THEN BX = 90
4 IF A$ = CHR$(0) + "M" AND BX = 0 THEN BX = 226
5 IF A$ = "+" AND GS > 1 THEN GS = GS - 1
6 IF A$ = "-" AND GS < 99 THEN GS = GS + 1
7 IF MP < 3 OR MP > 4 THEN 10
'BX and BY relate to the coordinates of the cannonball, IIRC.  AX and AY are
'   the coords' for the saucer.  I think.
8 IF BY < AY OR BY > AY + 8 THEN 10
9 IF BX > AX - 4 AND BX < AX + 16 THEN SC = SC + 1: PUT (AX - 1, AY), A%, PSET: PUT (B0, B1), C%, PSET: SCREEN 7, 0, 0, 0: PUT (B0, B1), C%, PSET: SCREEN 7, 0, 1, 0: BX = 0: BY = 165: B0 = 0: B1 = BY: GOTO 67
10 IF A$ = CHR$(27) THEN 82
11 IF BX > 0 THEN BY = BY - 2: IF BY < 0 THEN BY = BY + 2: SCREEN 7, 0, 0, 0: PUT (BX, BY), C%, PSET: SCREEN 7, 0, 1, 0: BY = 165: BX = 0
'Line 12 returns to the part of the game that continues whatever FOR/NEXT loop
'     is running.
12 GOSUB 90: ON MP GOTO 23, 56, 27, 52, 31, 60
'No images are drawn through PUT statements.  They're all made with DRAW
'   commands.  That's why all these strings are here.  SA$(x) is the string
'   used to animate the saucer.  The un-animated part of the saucer is stored
'   in the strings SA$ and SB$, IIRC.  PA$ was part of the original routine I
'   used to make the game run the right speed.  Most routines in this program
'   no longer use PA$, but there might be one or two PA$ routines running
'   around that I've forgotten about.  Remove the PA$ string at your own risk.
13 BM$ = "": SA$ = "C4;NR3G1R5F1;BR5;C1;F2;BD2;G2;BL17;H2;BU2;E2;BR12;C9;R4NL15F1NL17F1NL19G1;C7;NL17F1;C9;NL19G1NL17G1L15": LOCATE , , 0
14 SB$ = "C14;NR3G1R5F1;BR5;C1;F2;BD2;G2;BL17;H2;BU2;E2;BR12;C9;R4NL15F1NL17F1NL19G1;C7;NL17F1;C9;NL19G1NL17G1L15": LOCATE , , 0
15 PLAY "MLT150L64": KEY OFF: RANDOMIZE TIMER: SCREEN 7, 0, 0, 0: LOCATE , , 0: CLS : LOCATE 10, 1: CLS : SCREEN 7, 0, 1, 0: CLS
'IIRC, HS is the High Score, and SC is the regular score.
16 HS = 15: SA$(0) = SA$ + "H3;C4;R1BR9;C0;R1BR9R1"
17 SA$(1) = SB$ + "H3;C0;R1BR9;C4;R1BR9;C0;R1"
18 SA$(2) = SB$ + "H3;C0;R1BR9R1BR9;C4;R1"
19 SA$(3) = SA$ + "H3;C0;R1BR9R1BR9R1": PA$ = "P64": GS = 87: AN = 2: GOTO 32
'And here begins my hopeless mess of FOR/NEXT loops I used to move and animate
'    the saucer and cannonball.  Read it and cringe.  MP is used to help the
'    lump of code in Lines 2-12 determine what loop is being run.
20 MP = 1: GET (0, AY)-(23, AY + 8), A%: FOR T = 20 TO -2 STEP -2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (0, AY), A%, PSET: PSET (V0, V1), V2: T2 = BX: T3 = BY: GET (BX, BY)-(BX + 3, BY + 3), C%: T0 = 0: T1 = AY: GET (0, AY)-(23, AY + 8), A%
DRAW "BM8," + STR$(AY) + ";BL" + STR$(T) + SA$(INT(AN))
21 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
22 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
23 NEXT: A0 = -1
24 MP = 3: FOR AX = 4 TO 298 STEP 2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (AX - 3 + A0, AY), A%, PSET: PSET (V0, V1), V2: T0 = AX - 1: T1 = AY: GET (AX - 1, AY)-(AX + 21, AY + 8), A%: T2 = BX: T3 = BY: GET (BX, BY)-(BX + 3, BY + 3), C%
DRAW "BM" + STR$(8 + AX) + "," + STR$(AY) + SA$(INT(AN))
25 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
26 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
27 A0 = 0: NEXT
28 MP = 5: FOR T = 0 TO 20 STEP 2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (297, AY), A%, PSET: PSET (V0, V1), V2: T0 = 297: T1 = AY: GET (297, AY)-(319, AY + 8), A%: T2 = BX: T3 = BY: GET (BX, BY)-(BX + 3, BY + 3), C%
DRAW "BM308," + STR$(AY) + ";BR" + STR$(T) + SA$(INT(AN))
29 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
30 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
31 NEXT: PUT (B0, B1), C%, PSET: PUT (297, AY), A%, PSET: SCREEN 7, 0, 0, 0: PUT (297, AY), A%, PSET: SCREEN 7, 0, 1, 0: GOTO 65
32 RANDOMIZE 1: GOSUB 105
33 CA$ = ";C9;R3DL3DR3DL3DR3DL3R3F1;NL5;DL5G1R7DL7DR7DL7F1R5BR2;C8;DU8RD8RU8D3R1;C15;D2BL15;U2R1;C8;U3D8RU8RD8R1": CX$ = "C0;NU1;G1L2H1;NU1;BR4;R7;NU1;FR2E1U1;C1;BL4BU5;L0;BU2BL1;L0;BL5;L0;BL1BD2;L0;BD5;R0;BR7;R0"
'The following line draws the "ground" you see on the bottom of the screen.
34 LL = 0: FOR T = 0 TO 15: LL = LL + T: LINE (0 + LL, 190 - T)-(319 - LL, 190 - T), 6: NEXT: DRAW "BM90,165" + CA$: DRAW CX$: DRAW "BM226,165" + CA$: DRAW CX$: FOR T = 0 TO 99
'The following few lines of code create the "stars".  Better "star generating"
'    methods would be GETing the area around the random coordinate, then
'    scanning the contents of the array used by the GET statement to see if
'    randomly-picked coordinate is "all clear".
35 X = INT(RND * 318) + 1: Y = INT(RND * 186) + 1: IF POINT(X, Y) > 0 OR POINT(X - 1, Y) > 0 OR POINT(X + 1, Y) > 0 OR POINT(X, Y - 1) > 0 OR POINT(X, Y + 1) > 0 THEN 35
36 IF POINT(X - 1, Y - 1) > 0 OR POINT(X + 1, Y - 1) > 0 OR POINT(X + 1, Y + 1) > 0 OR POINT(X - 1, Y + 1) > 0 THEN 35
37 IF Y > 1 THEN IF POINT(X, Y - 2) > 0 THEN 35
38 IF X > 1 THEN IF POINT(X - 2, Y) > 0 THEN 35
39 IF X < 318 THEN IF POINT(X + 2, Y) > 0 THEN 35
40 IF POINT(X, Y + 2) > 0 THEN 35
41 IF Y > 2 THEN IF POINT(X, Y - 3) > 0 THEN 35
42 S(T, 0) = X: S(T, 1) = Y: PSET (X, Y), INT(RND * 15) + 1: NEXT
43 SS = 0: RANDOMIZE TIMER: GOTO 48
44 P = POINT(S(SS, 0), S(SS, 1)): N = INT(RND * 15): IF N = P THEN N = N - 1: IF N = -1 THEN N = 15
45 SCREEN 7, 0, 0, 0: PSET (S(SS, 0), S(SS, 1)), N: SCREEN 7, 0, 1, 0: PSET (S(SS, 0), S(SS, 1)), N: SS = SS + 1: IF SS > 99 THEN SS = 0: RETURN ELSE RETURN
46 V0 = S(SS, 0): V1 = S(SS, 1): P = POINT(V0, V1): N = INT(RND * 15): IF N = P THEN N = N - 1: IF N = -1 THEN N = 1
47 V2 = N: SS = SS + 1: SCREEN 7, 0, 1, 0: IF SS > 99 THEN SS = 0: RETURN ELSE RETURN
48 GOSUB 44: SOUND 32767, SG: PLAY "MN": GOSUB 107: GOTO 73
'More "saucer movement" routines.
49 MP = 4: FOR AX = 290 TO 2 STEP -2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (AX + 1, AY), A%, PSET: PSET (V0, V1), V2: T0 = AX - 1: T1 = AY: GET (AX - 1, AY)-(AX + 28, AY + 8), A%: T2 = BX: T3 = BY: GET (BX, BY)-(BX + 3, BY + 3), C%
DRAW "BM" + STR$(8 + AX) + "," + STR$(AY) + SA$(INT(AN))
50 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
51 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
52 NEXT: A0 = 1: GOTO 57
53 AN = 2: GET (291, AY)-(319, AY + 8), A%: MP = 2: FOR T = 20 TO -8 STEP -2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (291, AY), A%, PSET: PSET (V0, V1), V2: T0 = 291: T1 = AY: GET (291, AY)-(319, AY + 8), A%: T2 = BX: T3 = BY
GET (BX, BY)-(BX + 3, BY + 3), C%: DRAW "BM308," + STR$(AY) + ";BR" + STR$(T) + SA$(INT(AN))
54 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
55 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
56 NEXT: GOTO 49
57 MP = 6: FOR T = 0 TO 20 STEP 2: GOSUB 46: PUT (B0, B1), C%, PSET: PUT (A0, AY), A%, PSET: PSET (V0, V1), V2: T2 = BX: T3 = BY: GET (BX, BY)-(BX + 3, BY + 3), C%: T0 = 0: T1 = AY: GET (0, AY)-(23, AY + 8), A%
DRAW "BM8," + STR$(AY) + ";BL" + STR$(T) + SA$(INT(AN)): A0 = 0
58 IF BY < 163 AND BX > 0 THEN IF BY > 100 THEN LINE (BX + 1, BY)-(BX + 2, BY + 3), 7, BF: LINE (BX, BY + 1)-(BX + 3, BY + 2), 7, B ELSE IF BY > 40 THEN LINE (BX + 1, BY)-(BX + 2, BY + 1), 7, B ELSE LINE (BX + 1, BY)-(BX + 2, BY + 1), 8, B
59 IF BY = 163 THEN DRAW "BM" + STR$(BX + 1) + ",163;C7;RFL3": GOTO 2 ELSE 2
60 NEXT: PUT (B0, B1), C%, PSET: PUT (0, AY), A%, PSET: SCREEN 7, 0, 0, 0: PUT (0, AY), A%, PSET: SCREEN 7, 0, 1, 0: GOTO 65
61 B0 = 0: B1 = 165: BX = B0: BY = B1: SC = 0: SL = 20: RETURN
62 GOSUB 61: GOSUB 88
63 LL = 0: A1 = INT(RND * 78): A1 = A1 * 2: A1 = A1 + 1: AY = A1
'As I understand it, the following line determines whether the saucer will
'   come in from the Left or Right.
64 A0 = 0: GET (B0, B1)-(B0 + 3, B1 + 3), C%: IF RND > .5 THEN 20 ELSE 53
65 IF SC > HS THEN HS = SC
66 SL = SL - 1: GOSUB 88: IF SL > 0 THEN 63 ELSE 91
67 A0 = AX: A1 = AY: LL = 0
68 GOSUB 46: PUT (A0 - 1, A1), A%, PSET: PSET (V0, V1), V2: T0 = AX - 1: T1 = AY: GET (AX - 1, AY)-(AX + 21, AY + 8), A%: DRAW "BM" + STR$(8 + AX) + "," + STR$(AY) + SA$(3): T2 = B0: T3 = B1: GET (B0, B1)-(B0 + 3, B1 + 3), C%
PUT (B0, B1), C%, PSET: A0 = AX: A1 = AY: GOSUB 109: GOSUB 106: IF MP = 3 THEN AX = AX + 2 ELSE AX = AX - 2
69 A$ = INKEY$: IF AX < 1 THEN AX = 1 ELSE IF AX > 298 THEN AX = 298
70 AY = AY + INT(LL): IF LL < 1 THEN LL = LL + .2 ELSE LL = LL + .5: IF LL > 10 THEN LL = 10
71 IF AY > 191 THEN PUT (A0 - 1, A1), A%, PSET: T0 = A0 - 1: T1 = A1: GOSUB 109: GOTO 65
72 GOTO 68
73 ME = 1: GOTO 115
'Here's the routine where the words scroll across the screen.
74 LOCATE 25, 1: PRINT STRING$(40, 32); : FOR T = 1 TO 39: LOCATE 25, 41 - T: PRINT LEFT$(M$, T); : GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOTO 77
75 NEXT: MP = MP + 1: FOR T = 1 TO LEN(M$) + 1: LOCATE 25, 1: PRINT MID$(M$ + " ", T, 40); : GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOTO 77
76 NEXT: IF MP = 2 THEN 80 ELSE 81
77 A$ = INKEY$: IF A$ = CHR$(27) THEN CLEAR : SCREEN 2: SCREEN 0: SYSTEM
78 IF A$ <> " " THEN ON MP GOTO 75, 76, 75, 76, 75, 76
79 LOCATE 25, 1: PRINT STRING$(40, 32); : GOTO 62
80 M$ = "Your current score is shown on the bottom left of the screen.  The high score is shown on the bottom right.  Also shown is the amount of saucers remaining in the current game.": MP = 3: GOTO 74
81 M$ = "Press [+] or [-] during the game to adjust the game speed, [SPACEBAR] to start a new game, or [Esc] to exit.": MP = 5: GOTO 74
82 SCREEN 7, 0, 0, 0: COLOR 7: LOCATE 25, 1: PRINT "      Quit the current game (Y/N)?      "; : SCREEN 7, 0, 1, 0: WHILE INKEY$ > "": WEND
83 A$ = INKEY$: IF A$ = "Y" OR A$ = "y" THEN M$ = "Press the Spacebar to start a new game.  Press [Esc] to exit.  Press [I] to repeat the game introduction.  I can't believe you quit in the middle of a game! ": GOTO 86
84 IF A$ = CHR$(27) OR A$ = "N" OR A$ = "n" THEN GOSUB 88: GOTO 11
85 GOTO 83
86 ME = 5: BM$ = "": IF MP = 1 OR MP = 6 THEN SCREEN 7, 0, 0, 0: PUT (0, AY), A%, PSET: SCREEN 7, 0, 1, 0: PUT (0, AY), A%, PSET: GOTO 87
IF MP = 2 THEN SCREEN 7, 0, 0, 0: PUT (291, AY), A%, PSET: SCREEN 7, 0, 1, 0: PUT (291, AY), A%, PSET: GOTO 87
IF MP = 5 THEN SCREEN 7, 0, 0, 0: PUT (297, AY), A%, PSET: SCREEN 7, 0, 1, 0: PUT (297, AY), A%, PSET: GOTO 87
SCREEN 7, 0, 0, 0: PUT (AX - 1, AY), A%, PSET: SCREEN 7, 0, 1, 0: PUT (AX - 1, AY), A%, PSET
87 SCREEN 7, 0, 0, 0: PUT (B0, B1), C%, PSET: SCREEN 7, 0, 1, 0: PUT (B0, B1), C%, PSET: GOTO 120
88 SC$ = "0" + MID$(STR$(SC), 2, 2): SC$ = RIGHT$(SC$, 2): HS$ = "0" + MID$(STR$(HS), 2, 2): HS$ = RIGHT$(HS$, 2): SL$ = "0" + MID$(STR$(SL), 2, 2): SL$ = RIGHT$(SL$, 2)
89 SCREEN 7, 0, 0, 0: COLOR 7: LOCATE 25, 1: PRINT SC$; "         Saucers left: "; SL$; "           "; HS$; : SCREEN 7, 0, 1, 0: COLOR 7: LOCATE 25, 1: PRINT SC$; "         Saucers left: "; SL$; "           "; HS$; : RETURN
90 AN = AN + .25: IF AN > 3.75 THEN AN = 0: RETURN ELSE RETURN
'Game over!
91 M$ = "No more saucers!  You hit" + STR$(SC) + " out of 20 UFOs.  Your ranking is "
92 IF SC = 0 THEN T$ = "Saucer Lover": GOTO 98
93 IF SC < 6 THEN T$ = "Space Case": GOTO 98
94 IF SC < 11 THEN T$ = "Average Joe": GOTO 98
95 IF SC < 16 THEN T$ = "Adept But Faulty": GOTO 98
96 IF SC < 20 THEN T$ = CHR$(34) + "Far Out" + CHR$(34) + " (ha, ha, ha)": GOTO 98
97 T$ = "Out Of This World"
98 M$ = M$ + T$ + ".  Thank you for playing Shooting Targets. "
99 ME = 2: BM$ = M$: GOTO 120
100 MP = 2: FOR T = 1 TO LEN(M$): LOCATE 25, 1: PRINT MID$(M$, T, 40); : GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOSUB 44: PLAY "P64;P64": GOTO 102
101 NEXT: GOTO 99
102 A$ = INKEY$: IF A$ = CHR$(27) THEN CLEAR : SCREEN 2: SCREEN 0: SYSTEM
103 IF A$ <> " " THEN IF MP = 1 THEN 100 ELSE 101
104 LOCATE 25, 1: PRINT STRING$(40, 32); : GOTO 62
105 CIRCLE (160, 15), 16, 5: PAINT (160, 16), 5, 5: DRAW "BM144,12;C1;L2D1L3D1L1D1NL1D1R1D1R3D1R4D1R5D1R18U1R5U1R4U1R3U1R1U1NR1U1L1U1L3U1L2U1": DRAW "C3;R3D1R3D1R1D1R1D1R1L1D1L1D1L1D1L3D1L4D1L5D1L20U1L5U1L4U1L3U1L1U1L1U1L1R1U1R1U1R1U1R3U1R3"
RETURN
106 SG = GS * .01: SOUND 32767, SG: PLAY "MN": RETURN
107 FOR T = 0 TO 99: SCREEN 7, 0, 1, 0: GET (0, T)-(319, T), A%: GET (0, T + 100)-(319, T + 100), D%: SCREEN 7, 0, 0, 0: PUT (0, T), A%, PSET: PUT (0, T + 100), D%, PSET: SOUND 32767, .25: NEXT: SCREEN 7, 0, 1, 0
108 RETURN
109 SCREEN 7, 0, 1, 0: T0 = T0 - 2: IF T0 < 0 THEN T0 = 0
110 T1 = T1 - 10: T0 = T0 - 2: IF T1 < 0 THEN T1 = 0
111 IF T0 > 288 THEN T0 = 288
112 IF T1 > 181 THEN T1 = 0
113 IF T0 < 0 THEN T0 = 0
114 SCREEN 7, 0, 1, 0: GET (T0, T1)-(T0 + 31, T1 + 18), B%: GET (T2, T3)-(T2 + 3, T3 + 5), D%: SCREEN 7, 0, 0, 0: PSET (V0, V1), V2: PUT (T0, T1), B%, PSET: PUT (T2, T3), D%, PSET: SCREEN 7, 0, 1, 0: RETURN
115 ON ME GOTO 116, 117, 118, 119: GOTO 120
116 M$ = "Welcome to " + CHR$(34) + "Shooting Targets" + CHR$(34) + " - Public Domain software written by Richard Kelly.  Use the left and right arrows to shoot your left and right cannons.  "
M$=M$+"Your goal: As best you can, shoot down the saucers flying overhead."
GOTO 120
117 M$ = "Your score is shown on the bottom left and the high score on the bottom right.  The game ends when there are no more saucers.  Your ranking at the game's end is determined by your final score.": GOTO 120
118 M$ = "Press the Spacebar to start the game.  Press [Esc] to quit your current game or exit this program.  During the game, you may press [+] or [-] to adjust the game's speed.  Pressing [I] will repeat the game introduction.": GOTO 120
119 M$ = BM$
120 M$ = " " + M$ + " ": L = 1: PL = 8: LP = 0: SCREEN 7, 0, 0, 0: COLOR 7: LOCATE 25, 1: PRINT STRING$(40, 32); : SCREEN 7, 0, 1, 0: COLOR 7: LOCATE 25, 1: PRINT STRING$(40, 32); : SCREEN 7, 0, 0, 0: COLOR 7
121 SCREEN 7, 0, 0, 0: GET (1, 192)-(312, 199), B%: SCREEN 7, 0, 1, 0: COLOR 7
LOCATE 25, 1: PRINT MID$(M$, L, 2); : GET (LP, 192)-(LP + 7, 199), D%
SCREEN 7, 0, 0, 0: PUT (0, 192), B%, PSET: PUT (312, 192), D%, PSET: LP = LP + 1
IF LP >= 8 THEN LP = 0: L = L + 1: IF L > LEN(M$) THEN M$ = STRING$(39, 32): L = 1: GOTO 127
122 P = POINT(S(SS, 0), S(SS, 1)): N = INT(RND * 15): IF N = P THEN N = N - 1: IF N = -1 THEN N = 15
PSET (S(SS, 0), S(SS, 1)), N: SS = SS + 1: IF SS > 99 THEN SS = 0
SOUND 32767, .62: PLAY "MN"
123 A$ = INKEY$: IF A$ = CHR$(27) THEN 199
124 IF A$ = " " THEN 79
125 IF A$ = "I" OR A$ = "i" THEN ME = 1: GOTO 115
126 GOTO 121
127 SCREEN 7, 0, 0, 0: GET (1, 192)-(312, 199), B%: SCREEN 7, 0, 1, 0: COLOR 7
LOCATE 25, 1: PRINT MID$(M$, L, 2); : GET (LP, 192)-(LP + 7, 199), D%
SCREEN 7, 0, 0, 0: PUT (0, 192), B%, PSET: PUT (312, 192), D%, PSET: LP = LP + 1
IF LP >= 8 THEN LP = 0: L = L + 1: IF L > LEN(M$) THEN 190
128 P = POINT(S(SS, 0), S(SS, 1)): N = INT(RND * 15): IF N = P THEN N = N - 1: IF N = -1 THEN N = 15
PSET (S(SS, 0), S(SS, 1)), N: SS = SS + 1: IF SS > 99 THEN SS = 0
SOUND 32767, .62: PLAY "MN"
129 A$ = INKEY$: IF A$ = CHR$(27) THEN 199
130 IF A$ = " " THEN 79
131 IF A$ = "I" OR A$ = "i" THEN ME = 1: GOTO 115
132 GOTO 127
190 IF ME < 3 THEN ME = ME + 1: GOTO 115
191 ME = ME + 1: IF ME = 5 OR BM$ = "" THEN ME = 1
192 GOTO 115
199 SCREEN 0, 0, 0, 0: WIDTH 80: COLOR 7, 0: END: RUN

