DECLARE SUB ENDING () : DECLARE SUB MUSIC ()
DECLARE SUB CODES () : DECLARE SUB RACETRACK ()
DECLARE SUB SPEED () : DECLARE SUB SCORE ()
DECLARE SUB GUNS () : DECLARE SUB GMSCRN ()
DECLARE SUB INTRO () : DECLARE SUB GAME ()
DECLARE SUB INSTRUCT ()
COMMON SHARED NM$: COMMON SHARED SC$
COMMON SHARED lv$: COMMON SHARED CL$
COMMON SHARED LA$(): COMMON SHARED BL$()
COMMON SHARED EX$: COMMON SHARED s$
COMMON SHARED CDA$: COMMON SHARED CDB$
COMMON SHARED CDD$: COMMON SHARED CDE$
COMMON SHARED PII$
' ANTHONY CAROSONE
' MISSLE BLASTER
' STARTED 4/9/97
'********************************* INI *************************************
    DEFINT A-Z
    DECLARE SUB MOUSE (CX, DX, BX)
    DECLARE SUB mousepointer (SW)
    DIM SHARED A(9), B(500), C(500)
    DEF SEG = VARSEG(A(0))
    FOR I = 0 TO 17
       READ r
       POKE VARPTR(A(0)) + I, r
    NEXT I
'**************************** Machine Code *********************************
DATA &HB8,&H00,&H00   :
DATA &H55             :
DATA &H8B,&HEC        :
DATA &HCD,&H33        :
DATA &H92             :
DATA &H8B,&H5E,&H06   :
DATA &H89,&H07        :
DATA &H5D             :
DATA &HCA,&H02,&H00   :
    SCREEN 12
    COLOR 2
'****************************** Mouse set up *******************************
                CALL mousepointer(0)
                CALL mousepointer(1)
                CALL mousepointer(3)
CLS
'****************************** P R O G R A M ******************************
    RANDOMIZE TIMER
    DIM LA$(22, 4)
    DIM BL$(6, 3)
    OPEN "c:\willem\nieuwe\missle\speed.dat" FOR INPUT AS #1
    INPUT #1, s$
    INPUT #1, PII$
    CLOSE
    FOR LR = 1 TO 22
        FOR lc = 1 TO 4
                READ LA$(LR, lc)
        NEXT lc
    NEXT LR
    DO
        k$ = INKEY$
        LET BX = 0
        SCREEN 12: CLS
        LOCATE 8, 29: PRINT "MISSLE BLASTER 1.5"
        LOCATE 10, 24: PRINT "PROGRAMED BY ANTHONY CAROSONE"
        LOCATE 12, 30: PRINT "#1 INTRO"
        LOCATE 13, 30: PRINT "#2 GAME"
        LOCATE 14, 30: PRINT "#3 INSTRUCTIONS"
        LOCATE 15, 30: PRINT "#4 HIGH SCORE"
        LOCATE 16, 30: PRINT "#5 SPEED"
        LOCATE 17, 30: PRINT "#6 EXIT"
        LOCATE 19, 27: PRINT "CLICK NUMBER OF CHOICE"
        LOCATE 1, 1: PRINT "@"
        LOCATE 1, 80: PRINT "@"
        DO UNTIL BX = 1 OR BX = 2
                CALL MOUSE(CX, DX, BX)
                'LOCATE 5, 5: PRINT DX; " "; CX; " "; LS; " "; RS
                IF BX = 1 THEN
                     IF DX >= 230 AND DX <= 350 THEN
                        CALL mousepointer(2)
                        IF CX > 175 AND CX < 187 THEN CALL INTRO
                        IF CX > 193 AND CX < 205 THEN CALL GAME
                        IF CX > 209 AND CX < 221 THEN CALL INSTRUCT
                        IF CX > 225 AND CX < 237 THEN CALL SCORE
                        IF CX > 242 AND CX < 252 THEN CALL SPEED
                        IF CX > 258 AND CX < 268 THEN CLS : END
                     END IF
                     IF DX > 345 AND DX < 366 AND CX > 114 AND CX < 124 THEN CALL mousepointer(2): CALL RACETRACK
                END IF
        IF BX = 1 AND DX > 0 AND DX < 7 AND CX > 0 AND CX < 12 THEN LET LS = 1
        IF BX = 2 AND DX > 0 AND DX < 7 AND CX > 0 AND CX < 12 THEN LET LS = 0: LET RS = 0
        IF BX = 2 AND DX > 632 AND DX < 639 AND CX > 0 AND CX < 12 THEN RS = 1
        IF BX = 1 AND DX > 632 AND DX < 639 AND CX > 0 AND CX < 12 THEN LET LS = 0: LET RS = 0
        IF LS = 1 AND RS = 1 THEN
          CALL mousepointer(2)
          LET LS = 0: LET RS = 0
          CALL CODES
        END IF
        LOOP
        CALL mousepointer(0)
        CALL mousepointer(1)
        CALL mousepointer(3)
    LOOP
END

DATA 1,10,100,10,1,15,100,10,2,15,100,20,2,20,100,20,3,20,100,30,3,25,100,30
DATA 4,25,100,40,4,30,100,40,5,30,100,50,5,35,100,50,6,35,90,70,7,40,90,70
DATA 8,40,85,90,9,45,85,90,10,45,80,110,11,50,80,110,12,50,70,130,13,50,70,130
DATA 14,50,65,170,15,50,65,200,16,50,60,250,17,50,55,300

SUB CODES
CLS
LOCATE 1, 30: PRINT "CODE SCREEN"
LOCATE 3: PRINT "CODE", , "PASSWORD"
LOCATE 5: PRINT "EXTRA AMMO"
LOCATE 6: PRINT "EXTRA LEVELS"
LOCATE 9: PRINT "IMPERIAL MARCH"
LOCATE 7: PRINT "DIAGANOL BOMBS ONLY"
LOCATE 8: PRINT "LARGER BOMB EXPLOSIONS"
LOCATE 5, 29: PRINT "*********": COLOR 0
LOCATE 5, 29: INPUT "", PA$
COLOR 2
IF PA$ = "ARMAGEDON" THEN
        IF CDA$ <> "A" THEN
                LOCATE 5, 45: PRINT "EXTRA AMMO ADDED"
                LET CDA$ = "A"
        ELSE
                LOCATE 5, 45: PRINT "EXTRA AMMO REMOVED"
                LET CDA$ = "B"
        END IF
ELSE
        LOCATE 5, 45: PRINT "INVALID CODE"
END IF
LOCATE 6, 29: PRINT "****": COLOR 0
LOCATE 6, 29: INPUT "", PB$
COLOR 2
IF PB$ = "MUSE" THEN
        IF CDB$ <> "A" THEN
                LOCATE 6, 45: PRINT "EXTRA LEVELS ADDED"
                LET CDB$ = "A"
        ELSE
                LOCATE 6, 45: PRINT "EXTRA LEVELS REMOVED"
                LET CDB$ = "B"
        END IF
ELSE
        LOCATE 6, 45: PRINT "INVALID CODE"
END IF
LOCATE 7, 29: PRINT "*******": COLOR 0
LOCATE 7, 29: INPUT "", PD$
COLOR 2
IF PD$ = "SLANTED" THEN
        IF CDD$ <> "A" THEN
                LOCATE 7, 45: PRINT "DIAGANOL MODE ACTIVATED"
                CDD$ = "A"
        ELSE
                LOCATE 7, 45: PRINT "DIAGANOL MODE DEACTIVATED"
                CDD$ = "B"
        END IF
ELSE
        LOCATE 7, 45: PRINT "INVALID CODE"
END IF
LOCATE 8, 29: PRINT "****": COLOR 0
LOCATE 8, 29: INPUT "", PE$
COLOR 2
IF PE$ = "XINC" THEN
        IF CDE$ <> "A" THEN
                LOCATE 8, 45: PRINT "XINC MODE ACTIVATED"
                CDE$ = "A"
        ELSE
                LOCATE 8, 45: PRINT "XINC MODE DEACTIVATED"
                CDE$ = "B"
        END IF
ELSE
        LOCATE 8, 45: PRINT "INVALID CODE"
END IF
LOCATE 9, 29: PRINT "*****": COLOR 0
LOCATE 9, 29: INPUT "", CDC$
COLOR 2
IF CDC$ = "VADAR" THEN
        LOCATE 9, 45: PRINT "FEEL THE POWER OF THE DARK SIDE"
        CALL MUSIC
ELSE
        LOCATE 9, 45: PRINT "INVALID CODE"
END IF
LOCATE 11, 25: PRINT "HIT ANY KEY TO CONTINUE"
LET I$ = INPUT$(1)
END SUB

SUB ENDING
CLS
LET CL = VAL(CL$)
CIRCLE (200, 200), 2, 4: PAINT (200, 200), 4, 4
DIM BB(100): GET (197, 197)-(203, 203), BB
CLS
DIM BSPACE(1200): GET (0, 0)-(62, 62), BSPACE
'DESTROYED BASE
LET BLDS = 200
LINE (BLDS, 470)-(BLDS + 20, 460), 5, BF
DIM DB(1000): GET (200, 470)-(220, 430), DB
DIM BLANK(100): GET (0, 0)-(6, 6), BLANK
CLS
LINE (0, 480)-(640, 470), 3, BF
'base 1
LINE (95, 470)-(115, 450), 1, BF
CIRCLE (105, 450), 10, 1: PAINT (105, 449), 1, 1
LINE (100, 470)-(110, 460), 2, BF
LINE (105, 470)-(105, 460), 1
'base 2
LINE (525, 470)-(545, 450), 1, BF
CIRCLE (535, 450), 10, 1: PAINT (535, 449), 1, 1
LINE (530, 470)-(540, 460), 2, BF
LINE (535, 470)-(535, 460), 1
'buildings
FOR BLDS = 185 TO 525 STEP 90
        LINE (BLDS, 470)-(BLDS + 20, 430), 5, BF
        LINE (BLDS + 5, 470)-(BLDS + 15, 460), 2, BF
        LINE (BLDS + 10, 470)-(BLDS + 10, 460), 1
        LINE (BLDS + 5, 450)-(BLDS + 15, 440), 6, BF
        LINE (BLDS + 10, 450)-(BLDS + 10, 440), 1: LINE (BLDS + 5, 445)-(BLDS + 15, 445), 1
NEXT BLDS
SLEEP 2
LOCATE 20, 23: PRINT "CONGRADULATIONS YOU'VE SAVED THE CITY"
SLEEP 2
LOCATE 20, 23: PRINT "                                     "
LOCATE 19, 23: PRINT "THE CITY CELEBRATES WITH A FIREWORK"
LOCATE 20, 30: PRINT "DISPLAY IN YOUR HONOR"
SLEEP 3
LOCATE 19, 23: PRINT "                                     "
LOCATE 20, 30: PRINT "                     "
s = VAL(s$)
PII = VAL(PII$)
CX = 30: DX = 230
FOR FW = 1 TO 5
    CX = CX + 50
    FOR GN = 1 TO 2
        IF GN = 2 THEN DX = DX + 100
        IF GN = 2 THEN FW = FW + 2
        IF GN = 1 THEN
                XC = 105: YC = 440
        END IF
        IF GN = 2 THEN
                XC = 535: YC = 440
        END IF
        LINE (DX, CX)-(XC, YC)
        FOR EX = 1 TO 20
                CIRCLE (DX, CX), EX, FW
                FOR D = 1 TO 8000 / s: NEXT D
        NEXT EX
        FOR EX = 20 TO 1 STEP -1
                CIRCLE (DX, CX), EX, 0
                FOR D = 1 TO 8000 / s: NEXT D
        NEXT EX
        PUT (DX - 21, CX - 21), BSPACE, PSET
        LINE (DX, CX)-(XC, YC), 0
    NEXT GN
    FW = FW - 2
    DX = DX - 100
NEXT FW
LOCATE 20, 25: PRINT "OH SHIT!! IS THAT ANOTHER BOMB?"
SLEEP 3
LOCATE 20, 25: PRINT "                               "
FOR ABF = 21 TO 423
        PUT (325, ABF), BB, PSET
        FOR DE = 1 TO 10000 * PII / s: NEXT DE
NEXT ABF
FOR EX = 1 TO 230
        CIRCLE (325, 423), EX, 6: PAINT (325, 423), 6, 6
        FOR DE = 1 TO 10000 * PII / s: NEXT DE
NEXT EX
FOR EX = 1 TO 230
        CIRCLE (325, 423), EX, 0: PAINT (325, 423), 0, 0
        FOR DE = 1 TO 10000 * PII / s: NEXT DE
NEXT EX
CLS
LOCATE 15, 27: PRINT "GAME OVER UNTIL NEXT TIME"
SLEEP 4
END SUB

SUB GAME
   SHARED lv$
   LET SC$ = "0"
   CLS
   PRINT , , "SETTINGS SCREEN"
   LOCATE 3, 1: PRINT "ENTER NAME:"
   LOCATE 3, 35: PRINT "ENTER SKILL LEVEL:"
   PRINT : COLOR 4
   PRINT "LEVEL", "SPEED", "BOMBS", "AMMO", "BOMB POINT VALUE": PRINT
   LET lc = 20
   IF CDB$ = "A" THEN lc = lc + 2
   FOR LR = 1 TO lc
        PRINT LR, LA$(LR, 1), LA$(LR, 2), " "; LA$(LR, 3), LA$(LR, 4)
   NEXT LR
   COLOR 2
   LOCATE 3, 13: INPUT "", NM$
   LOCATE 3, 55: INPUT "", lv$
   IF VAL(lv$) > lc THEN
        CLS
        PRINT "I ASKED FOR A NUMBER BETWEEN 1 AND 20.  DUE TO YOUR LACK IN INTELLEGENCE"
        PRINT "YOU WERE UNABLE TO REACH YOUR MISSLE DEFENCE POST.  YOUR CITY WAS DESTORYED!"
        PRINT : PRINT , , "GAME OVER    MORON"
        END
   END IF
   LOCATE 28: PRINT , "        HIT ANY KEY TO CONTINUE"
   I$ = INPUT$(1)
   LET CL$ = "4"
   DO UNTIL VAL(CL$) = 0 OR EX$ = "1" OR VAL(lv$) > lc
        CALL GMSCRN
        lv$ = STR$(VAL(lv$) + 1)
   LOOP
   CLS
   FOR BLL = 1 TO 4
        LET BL$(BLL, 1) = "0"
   NEXT BLL
   IF EX$ = "0" THEN
        LOCATE 14: PRINT , , "GAME OVER"
        LOCATE 15: PRINT , , "SCORE "; SC$
   END IF
   IF EX$ <> "1" THEN
        DIM SB$(11, 2)
        OPEN "c:\missle\score.dat" FOR INPUT AS #1
        FOR SCNT = 1 TO 10
                INPUT #1, SB$(SCNT, 1)
                INPUT #1, SB$(SCNT, 2)
        NEXT SCNT
        CLOSE
        LET NM$ = LEFT$(NM$, 12)
        LET SB$(11, 1) = NM$: LET SB$(11, 2) = SC$
        FOR X = 1 TO 11
                SW = 0
                FOR Y = 1 TO 11 - X
                        IF VAL(SB$(Y, 2)) < VAL(SB$(Y + 1, 2)) THEN
                                SWAP SB$(Y, 1), SB$(Y + 1, 1)
                                SWAP SB$(Y, 2), SB$(Y + 1, 2)
                                SW = 1
                        END IF
                NEXT Y
                IF SW = 0 THEN EXIT FOR
        NEXT X
        OPEN "c:\missle\score.dat" FOR OUTPUT AS #1
        FOR SCNT = 1 TO 10
                WRITE #1, SB$(SCNT, 1)
                WRITE #1, SB$(SCNT, 2)
        NEXT SCNT
        CLOSE #1
   END IF
   CALL mousepointer(0)
   CALL mousepointer(1)
   CALL mousepointer(3)
   LOCATE 20: PRINT , , "CLICK HERE TO CONTINUE"
   DO UNTIL BX = 1
        CALL MOUSE(CX, DX, BX)
   LOOP
   IF VAL(lv$) > lc AND EX$ <> "1" THEN CALL ENDING
   BX = 0
   EX$ = "0"
END SUB

SUB GMSCRN
CLS
LET s = VAL(s$)
LET PII = VAL(PII$)
LET EX$ = "0"
LET lv = VAL(lv$)
LET CL = VAL(CL$)
DIM SCC AS LONG
LET SCC = VAL(SC$)
LET SPD = VAL(LA$(lv, 1))
LOCATE 15: PRINT , , "LEVEL "; lv
LOCATE 16: PRINT , , "SCORE "; SCC
LOCATE 17: PRINT , , "CITIES REMAINING  "; CL
LOCATE 19: PRINT , , "HIT ANY KEY TO CONTINUE"
I$ = INPUT$(1)
CALL mousepointer(0)
CALL mousepointer(1)
CALL mousepointer(3)
CLS
DIM BSPACE(1200): GET (5, 5)-(52, 52), BSPACE
'DESTROYED BASE
LET BLDS = 200
LINE (BLDS, 470)-(BLDS + 20, 460), 5, BF
DIM DB(1000): GET (200, 470)-(220, 430), DB
DIM BLANK(100): GET (0, 0)-(6, 6), BLANK
CLS
LINE (0, 480)-(640, 470), 3, BF
'base 1
LINE (95, 470)-(115, 450), 1, BF
CIRCLE (105, 450), 10, 1: PAINT (105, 449), 1, 1
LINE (100, 470)-(110, 460), 2, BF
LINE (105, 470)-(105, 460), 1
'base 2
LINE (525, 470)-(545, 450), 1, BF
CIRCLE (535, 450), 10, 1: PAINT (535, 449), 1, 1
LINE (530, 470)-(540, 460), 2, BF
LINE (535, 470)-(535, 460), 1
'buildings
FOR BLDS = 185 TO 525 STEP 90
        LINE (BLDS, 470)-(BLDS + 20, 430), 5, BF
        LINE (BLDS + 5, 470)-(BLDS + 15, 460), 2, BF
        LINE (BLDS + 10, 470)-(BLDS + 10, 460), 1
        LINE (BLDS + 5, 450)-(BLDS + 15, 440), 6, BF
        LINE (BLDS + 10, 450)-(BLDS + 10, 440), 1: LINE (BLDS + 5, 445)-(BLDS + 15, 445), 1
        LINE (0, 20)-(640, 20), 1
NEXT BLDS
LET BL$(1, 2) = "185"
LET BL$(2, 2) = "275"
LET BL$(3, 2) = "365"
LET BL$(4, 2) = "455"
LET BL$(6, 2) = "525"
LET BL$(5, 2) = "95"
FOR BLL = 1 TO 6
        IF BL$(BLL, 1) = "1" THEN PUT (VAL(BL$(BLL, 2)), 430), DB, PSET
NEXT BLL
LOCATE 1, 1: PRINT NM$
LOCATE 1, 45: PRINT "LEVEL"; lv
LOCATE 1, 60: PRINT "SCORE"; SCC
LET MA = VAL(LA$(lv, 3))
LET MB = VAL(LA$(lv, 3))
IF CDA$ = "A" THEN MA = MA + 100
IF CDA$ = "A" THEN MB = MB + 100
LET BMD = VAL(LA$(lv, 2))
LOCATE 27, 1: PRINT "AMMO"; MA
LOCATE 27, 71: PRINT "AMMO"; MB
CIRCLE (100, 100), 2, 1: PAINT (100, 100), 1, 1
CIRCLE (200, 200), 2, 4: PAINT (200, 200), 4, 4
DIM MS(100): GET (97, 97)-(103, 103), MS
DIM BB(100): GET (197, 197)-(203, 203), BB
CIRCLE (100, 100), 2, 0: PAINT (100, 100), 0, 0
CIRCLE (200, 200), 2, 0: PAINT (200, 200), 0, 0
'****************************************************************************
DO UNTIL CL = 0 OR BMD = 0
        BMD = BMD - 1
        RANDOMIZE TIMER
        LOCATE 1, 30: PRINT "BOMBS"; BMD
        T = INT(RND * 6) + 1
        DT = INT(RND * 6) + 1
        DON = 2
        IF CDD$ = "A" THEN DON = 1
        RD = INT(RND * DON) + 1
        D = RD
        IF D = 2 THEN
                BBS = 21
                IF T = 1 THEN h = 192
                IF T = 2 THEN h = 282
                IF T = 3 THEN h = 372
                IF T = 4 THEN h = 462
                IF T = 5 THEN h = 105
                IF T = 6 THEN h = 535
        ELSE
                IF DT = 1 THEN BBS = 21: DH = 594
                IF DT = 2 THEN BBS = 71: DH = 634
                IF DT = 3 THEN BBS = 51: DH = 0
                IF DT = 4 THEN BBS = 21: DH = 60
                IF DT = 5 THEN BBS = 21: DH = 507
                IF DT = 6 THEN BBS = 21: DH = 133
        END IF
        DO UNTIL BBS = 423
                LOCATE 27, 1: PRINT "AMMO"; MA
                LOCATE 27, 71: PRINT "AMMO"; MB
                D = RD
                IF D = 1 THEN SH = DH: ST = DT
                IF D = 2 THEN SH = h: ST = T
                'LOCATE 1, 1: PRINT ST, D
                IF INKEY$ = CHR$(27) THEN
                        EX$ = "1"
                        GOTO ender
                END IF
                IF D = 2 THEN
                        LET BBS = BBS + 1
                        PUT (h, BBS), BB, PSET
                        FOR DE = 1 TO 10000 * PII / s - (500 * SPD) / s: NEXT DE
                ELSE
                        LET BBS = BBS + 1
                        IF DT = 5 OR DT = 1 OR DT = 2 THEN DH = DH - 1
                        IF DT = 4 OR DT = 3 OR DT = 6 THEN DH = DH + 1
                        PUT (DH, BBS), BB, PSET
                        FOR DE = 1 TO 10000 * PII / s - (500 * SPD) / s: NEXT DE
                END IF
                CALL MOUSE(CX, DX, BX)
                IF BX = 1 AND MA > 0 AND CX > 40 AND CX < 398 AND BL$(5, 1) <> "1" AND DX > 40 AND DX < 600 THEN
                        GOSUB MISS
                        IF BX = 1 OR BX = 2 THEN
                                IF DX + 12 >= SH AND DX - 12 <= SH THEN
                                        IF CX + 12 >= BBS AND CX - 12 <= BBS THEN
                                                LOCATE 1, 65: PRINT SCC
                                                SCC = SCC + VAL(LA$(lv, 4))
                                                EXIT DO
                                        END IF
                                END IF
                        END IF
                END IF
                IF BX = 2 AND MB > 0 AND CX > 40 AND CX < 398 AND BL$(6, 1) <> "1" AND DX > 40 AND DX < 600 THEN
                        GOSUB MISS
                        IF BX = 1 OR BX = 2 THEN
                                IF DX + 12 >= SH AND DX - 12 <= SH THEN
                                        IF CX + 12 >= BBS AND CX - 12 <= BBS THEN
                                                LOCATE 1, 65: PRINT SCC
                                                SCC = SCC + VAL(LA$(lv, 4))
                                                EXIT DO
                                        END IF
                                END IF
                        END IF
                END IF
        LOOP
        IF BBS = 423 THEN GOSUB DEST
LOOP
'*****************************************************************************
GOTO ender
DEST:
        XC = 0
        IF CDE$ = "A" THEN XC = 30
        PUT (SH, BBS), BLANK, PSET
        FOR EX = 1 TO 30 + XC
                CIRCLE (SH, 423), EX, 6: PAINT (SH, 423), 6, 6
                FOR DE = 1 TO 10000 * PII / s: NEXT DE
        NEXT EX
        FOR EX = 1 TO 30 + XC
                CIRCLE (SH, 423), EX, 0: PAINT (SH, 423), 0, 0
                FOR DE = 1 TO 10000 * PII / s: NEXT DE
        NEXT EX
        PUT (VAL(BL$(ST, 2)), 430), DB, PSET
        IF VAL(BL$(ST, 1)) <> 1 THEN
                BL$(ST, 1) = "1"
                IF ST <> 5 AND ST <> 6 THEN
                        CL = CL - 1
                        SCC = SCC - 100
                        LOCATE 1, 65: PRINT SCC
                ELSE
                        SCC = SCC - 200
                END IF
        END IF
RETURN
MISS:
        IF BX = 1 THEN
                MA = MA - 1: 'LOCATE 27, 6: PRINT MA
                XC = 105: YC = 440
        END IF
        IF BX = 2 THEN
                MB = MB - 1: 'LOCATE 27, 76: PRINT MB
                XC = 535: YC = 440
        END IF
        LINE (DX, CX)-(XC, YC)
        FOR EX = 1 TO 20
                CIRCLE (DX, CX), EX, 6
                FOR D = 1 TO 2000 * PII / s: NEXT D
        NEXT EX
        FOR EX = 20 TO 1 STEP -1
                CIRCLE (DX, CX), EX, 0
        NEXT EX
        PUT (DX - 21, CX - 21), BSPACE, PSET
        LINE (DX, CX)-(XC, YC), 0
RETURN
ender:
LET CL$ = STR$(CL)
LET lv$ = STR$(lv)
LET SC$ = STR$(SCC)
CALL mousepointer(2)
END SUB

SUB INSTRUCT
   CLS
   PRINT , , "INSTRUCTIONS SCREEN": PRINT
   PRINT "   AT SETTING SCREEN ENTER NAME AND DIFFICULTY LEVEL.  AT PLAYING SCREEN"
   PRINT "YOU HAVE TWO MISSLE STATIONS AND 4 CITIES.  AIM BY MOVING MOUSE AND FIRE"
   PRINT "BY PRESSING EITHER MOUSE BUTTON, THE LEFT BUTTON FIRES THE LEFT MISSLE"
   PRINT "STATION AND RIGHT FIRES THE RIGHT STATION.  BOMBS WILL FALL FROM ABOVE."
   PRINT "AIM AND FIRE AT BOMBS TO DESTROY THEM.  IF A BOMB HITS A CITY IT IS"
   PRINT "DESTROYED.  THE GAME ENDS WHEN YOU HAVE NO CITIES LEFT.  WHEN ALL BOMBS"
   PRINT "ARE DROPPED YOU WILL GO TO NEXT SKILL LEVEL.  IF A BOMB DESTROYS A MISSLE"
   PRINT "STATION YOU WILL NOT BE ABLE TO USE IT.  FOR THE SAFTEY OF CITIES MISSLES"
   PRINT "HAVE A MINIMUM FIRING ALTITUDE.  HIT ESC KEY WHILE PLAYING TO RETURN TO"
   PRINT "MAIN MENU.  HAVE FUN"
   PRINT : PRINT , "      HIT ANY KEY TO RETURN TO MENU SCREEN"
   I$ = INPUT$(1)
END SUB

SUB INTRO
   CLS
   LET s = VAL(s$)
   LET PII = VAL(PII$)
   COLOR 4
   LOCATE 15, 30: PRINT "Missle Blaster"
   SLEEP 2
   COLOR 2
   LINE (0, 480)-(245, 235)
   FOR BS = 1 TO 30
        CIRCLE (245, 235), BS, 6
        FOR DE = 1 TO 8000 * PII / s: NEXT DE
   NEXT BS
   COLOR 0
   LINE (0, 480)-(245, 235)
   FOR BS = 30 TO 1 STEP -1
        CIRCLE (245, 235), BS, 0
        FOR DE = 1 TO 8000 * PII / s: NEXT DE
   NEXT BS
   COLOR 2
   LINE (620, 480)-(320, 235)
   FOR BS = 1 TO 30
        CIRCLE (320, 235), BS, 6
        FOR DE = 1 TO 8000 * PII / s: NEXT DE
   NEXT BS
   COLOR 0
   LINE (620, 480)-(320, 235)
   FOR BS = 30 TO 1 STEP -1
        CIRCLE (320, 235), BS, 0
        FOR DE = 1 TO 800 * PII / s: NEXT DE
   NEXT BS
   LOCATE 15, 30: PRINT "                       "
   COLOR 2
   FOR sp = 23 TO 12 STEP -1
        SLEEP 1
                                 LOCATE sp: PRINT "*******************************************************************************"
        IF sp + 1 <= 23 THEN LOCATE sp + 1: PRINT "     The year is 2057 and the earth has fallen into war once again.  The       "
        IF sp + 2 <= 23 THEN LOCATE sp + 2: PRINT "governments have declared total war.  Civilian cities are bombed regulary.     "
        IF sp + 3 <= 23 THEN LOCATE sp + 3: PRINT "Missle bases are required to destroy incoming bombs on a regular basis.  You   "
        IF sp + 4 <= 23 THEN LOCATE sp + 4: PRINT "are the commander of the missle stations protecting a large metropolis of      "
        IF sp + 5 <= 23 THEN LOCATE sp + 5: PRINT "Pennsylvania.  Your station is city AH69 (Canonsburg, PA).  Secret reports     "
        IF sp + 6 <= 23 THEN LOCATE sp + 6: PRINT "have come in that 20 bomb runs have been planned to destroy your city.  Your   "
        IF sp + 7 <= 23 THEN LOCATE sp + 7: PRINT "mission is to protect the 4 major structures in the north west section of the  "
        IF sp + 8 <= 23 THEN LOCATE sp + 8: PRINT "city.  The missle stations are not prepared for such a large scale attack, so  "
        IF sp + 9 <= 23 THEN LOCATE sp + 9: PRINT "supplies are limited and slowly running out.  As the attacks continue, you will"
        IF sp + 10 <= 23 THEN LOCATE sp + 10: PRINT "have less and less ammo.  Good luck Canonsburg is in your hands!               "
        IF sp + 11 <= 23 THEN LOCATE sp + 11: PRINT "*******************************************************************************"
        IF sp + 12 <= 23 THEN LOCATE sp + 12: PRINT "                                                                               "
   NEXT sp
   LOCATE 30, 1
   FOR cu = 1 TO 24
        SLEEP 1: PRINT " "
   NEXT cu
   COLOR 2
END SUB

SUB MOUSE (CX, DX, BX)
         
           POKE VARPTR(A(4)), &H92
          CALL absolute(CX, VARPTR(A(0)))
               CX = CX '/ 4
           POKE VARPTR(A(4)), &H91
          CALL absolute(DX, VARPTR(A(0)))
              DX = DX '/ 4
          POKE VARPTR(A(4)), &H93
          CALL absolute(BX, VARPTR(A(0)))

END SUB

SUB mousepointer (SW)
         
           POKE VARPTR(A(0)) + 1, SW
          CALL absolute(C, VARPTR(A(0)))

END SUB

SUB MUSIC
PLAY "mn t150 o1 l4 g g g l8 e-. b-16 g4 l8 e-. b-16 g2"
PLAY "o2 l4 d d d l8 e-. o1 b-16 f+4 l8 e-. b-16 g2"
PLAY "o2 g4 o1 g8. g16 o2 g4 f+8. f16 e16 e-16 mse8 p8"
PLAY "o1 g+8 ml o2 mn c+4 c8. o1 b16 b-16 a16ms b-8 p8"
PLAY "e-8 ml f+4 mn e-8. f+16 b-4 g8. b-16 o2 d2"
PLAY "g4 o1 g8. g16 o2 g4 f+8. f16 e16 e-16 ms e8 p8"
PLAY "o1 g+8 ml o2 mn c+4 c8. o1 b16 b-16 a16 ms b-8 p8"
PLAY "e-8 ml f+4 mn e-8. b-16 g4 e-8. b-16 g2"
PLAY "o2 l4 d d d e-8 e-8 d d d e-8 e-8 ms d 01 p4"
PLAY "l16 mn gg ms g8"
END SUB

SUB RACETRACK
LET s = VAL(s$)
LET PII = VAL(PII$)
' CAR 1 FRAME A
CLS
CIRCLE (90, 240), 30, 1: PAINT (90, 240), 14, 1
CIRCLE (60, 284), 10, 6: PAINT (60, 284), 6, 6
LINE (60, 294)-(60, 274)
CIRCLE (120, 284), 10, 6: PAINT (120, 284), 6, 6
LINE (120, 294)-(120, 274)
CIRCLE (140, 255), 5: PAINT (140, 255)
LINE (40, 240)-(140, 280), 1, BF
LINE (40, 250)-(50, 260), 4, BF
DIM AA(2500): GET (36, 209)-(146, 295), AA
LINE (40, 240)-(140, 280), 2, BF
LINE (40, 250)-(50, 260), 4, BF
DIM BA(2500): GET (36, 209)-(146, 295), BA
LINE (40, 240)-(140, 280), 3, BF
LINE (40, 250)-(50, 260), 4, BF
DIM CA(2500): GET (36, 209)-(146, 295), CA
LINE (40, 240)-(140, 280), 5, BF
LINE (40, 250)-(50, 260), 4, BF
DIM DA(2500): GET (36, 209)-(146, 295), DA
  
' CAR 1 FRAME B
CLS
CIRCLE (90, 240), 30, 1: PAINT (90, 240), 14, 1
CIRCLE (60, 284), 10, 6: PAINT (60, 284), 6, 6
LINE (67, 277)-(53, 291)
CIRCLE (120, 284), 10, 6: PAINT (120, 284), 6, 6
LINE (127, 277)-(113, 291)
CIRCLE (140, 255), 5: PAINT (140, 255)
LINE (40, 240)-(140, 280), 1, BF
LINE (40, 250)-(50, 260), 4, BF
DIM AB(2500): GET (36, 209)-(146, 295), AB
LINE (40, 240)-(140, 280), 2, BF
LINE (40, 250)-(50, 260), 4, BF
DIM BB(2500): GET (36, 209)-(146, 295), BB
LINE (40, 240)-(140, 280), 3, BF
LINE (40, 250)-(50, 260), 4, BF
DIM CB(2500): GET (36, 209)-(146, 295), CB
LINE (40, 240)-(140, 280), 5, BF
LINE (40, 250)-(50, 260), 4, BF
DIM DB(2500): GET (36, 209)-(146, 295), DB

' CAR 1 FRAME C
CLS
CIRCLE (90, 240), 30, 1: PAINT (90, 240), 14, 1
CIRCLE (60, 284), 10, 6: PAINT (60, 284), 6, 6
LINE (50, 284)-(70, 284)
CIRCLE (120, 284), 10, 6: PAINT (120, 284), 6, 6
LINE (110, 284)-(130, 284)
CIRCLE (140, 255), 5: PAINT (140, 255)
LINE (40, 240)-(140, 280), 1, BF
LINE (40, 250)-(50, 260), 4, BF
DIM AC(2500): GET (36, 209)-(146, 295), AC
LINE (40, 240)-(140, 280), 2, BF
LINE (40, 250)-(50, 260), 4, BF
DIM BC(2500): GET (36, 209)-(146, 295), BC
LINE (40, 240)-(140, 280), 3, BF
LINE (40, 250)-(50, 260), 4, BF
DIM CC(2500): GET (36, 209)-(146, 295), CC
LINE (40, 240)-(140, 280), 5, BF
LINE (40, 250)-(50, 260), 4, BF
DIM DC(2500): GET (36, 209)-(146, 295), DC

' CAR 1 FRAME D
CLS
CIRCLE (90, 240), 30, 1: PAINT (90, 240), 14, 1
CIRCLE (60, 284), 10, 6: PAINT (60, 284), 6, 6
LINE (53, 277)-(67, 291)
CIRCLE (120, 284), 10, 6: PAINT (120, 284), 6, 6
LINE (113, 277)-(127, 291)
CIRCLE (140, 255), 5: PAINT (140, 255)
LINE (40, 240)-(140, 280), 1, BF
LINE (40, 250)-(50, 260), 4, BF
DIM AD(2500): GET (36, 209)-(146, 295), AD
LINE (40, 240)-(140, 280), 2, BF
LINE (40, 250)-(50, 260), 4, BF
DIM BD(2500): GET (36, 209)-(146, 295), BD
LINE (40, 240)-(140, 280), 3, BF
LINE (40, 250)-(50, 260), 4, BF
DIM CD(2500): GET (36, 209)-(146, 295), CD
LINE (40, 240)-(140, 280), 5, BF
LINE (40, 250)-(50, 260), 4, BF
DIM DD(2500): GET (36, 209)-(146, 295), DD

DO UNTIL CH$ = "N"
        CLS
        LOCATE 1, 1: PRINT "SECRET GAME:   HIT ANY KEY TO BEGIN RACE"
        LET I$ = INPUT$(1)
        LET X = 100
        LET Y = 100
        LET Z = 100
        LET W = 100
        LINE (609, 0)-(609, 600)
        RANDOMIZE TIMER
        DO UNTIL X > 500 OR Y > 500 OR Z > 500 OR W > 500
                PUT (X, 50), AA, PSET
                PUT (Y, 150), BA, PSET
                PUT (Z, 250), CA, PSET
                PUT (W, 350), DA, PSET
                GOSUB DELAY
                X = X + INT(RND * 3) + 1
                Y = Y + INT(RND * 3) + 1
                Z = Z + INT(RND * 3) + 1
                W = W + INT(RND * 3) + 1
                PUT (X, 50), AB, PSET
                PUT (Y, 150), BB, PSET
                PUT (Z, 250), CB, PSET
                PUT (W, 350), DB, PSET
                GOSUB DELAY
                X = X + INT(RND * 3) + 1
                Y = Y + INT(RND * 3) + 1
                Z = Z + INT(RND * 3) + 1
                W = W + INT(RND * 3) + 1
                PUT (X, 50), AC, PSET
                PUT (Y, 150), BC, PSET
                PUT (Z, 250), CC, PSET
                PUT (W, 350), DC, PSET
                GOSUB DELAY
                X = X + INT(RND * 3) + 1
                Y = Y + INT(RND * 3) + 1
                Z = Z + INT(RND * 3) + 1
                W = W + INT(RND * 3) + 1
                PUT (X, 50), AD, PSET
                PUT (Y, 150), BD, PSET
                PUT (Z, 250), CD, PSET
                PUT (W, 350), DD, PSET
                GOSUB DELAY
                X = X + INT(RND * 3) + 1
                Y = Y + INT(RND * 3) + 1
                Z = Z + INT(RND * 3) + 1
                W = W + INT(RND * 3) + 1
        LOOP
        LOCATE 1, 1
        IF X = Y AND Y = Z AND Z = W THEN PRINT "ITS A TIE                                      "
        IF X >= Y AND X >= Z AND X >= W THEN PRINT "CAR ONE WINS                                   "
        IF Y >= X AND Y >= Z AND Y >= W THEN PRINT "CAR TWO WINS                                   "
        IF Z >= X AND Z >= Y AND Z >= W THEN PRINT "CAR THREE WINS                                 "
        IF W >= X AND W >= Y AND W >= Z THEN PRINT "CAR FOUR WINS                                  "
        INPUT "RACE AGAIN Y/N: ", CH$
LOOP
GOTO exiter
DELAY:
        FOR C = 1 TO 6000 * PII / s: NEXT C
RETURN
exiter:
END SUB

SUB SCORE
CLS
DIM SB$(10, 2)
OPEN "c:\missle\score.dat" FOR INPUT AS #1
FOR SCNT = 1 TO 10
        INPUT #1, SB$(SCNT, 1)
        INPUT #1, SB$(SCNT, 2)
NEXT SCNT
CLOSE
LOCATE 3, 35: PRINT "SCORE BOARD"
FOR SCNT = 1 TO 10
        LOCATE 5 + SCNT, 30: PRINT SB$(SCNT, 1)
        LOCATE 5 + SCNT, 45: PRINT SB$(SCNT, 2)
NEXT SCNT
LOCATE 17, 28: PRINT "HIT ANY KEY TO CONTINUE"
LET I$ = INPUT$(1)
END SUB

SUB SPEED
CLS
LOCATE 1, 30: PRINT "SPEED MENU"
LOCATE 3, 1: PRINT "ENTER COMPUTER SPEED:      1=486  2=MEDIUM  3=PENTIUM  4=PENTIUM II"
LOCATE 4, 5: PRINT "THESE SPEED SETTINGS SHOULD WORK FOR MOST COMPUTERS.  DEFAULT IS 4"
LOCATE 3, 24: INPUT "", sp
OPEN "c:\missle\speed.dat" FOR OUTPUT AS #1
SELECT CASE sp
CASE IS = 1
        sp$ = "8"
        PII$ = "1"
        WRITE #1, sp$
        WRITE #1, PII$
CASE IS = 2
        sp$ = "4"
        PII$ = "1"
        WRITE #1, sp$
        WRITE #1, PII$
CASE IS = 3
        sp$ = "1"
        PII$ = "1"
        WRITE #1, sp$
        WRITE #1, PII$
CASE ELSE
        sp$ = "1"
        PII$ = "2"
        WRITE #1, sp$
        WRITE #1, PII$
END SELECT
CLOSE
LOCATE 6, 24: PRINT "HIT ANY KEY TO CONTINUE"
LET I$ = INPUT$(1)
END SUB

