Author Topic: Tech Invaders 2 by SierraKen  (Read 580 times)

Offline Qwerkey

  • Moderator
  • Forum Resident
  • Posts: 736
Tech Invaders 2 by SierraKen
« on: May 09, 2020, 04:51:01 AM »
Tech Invaders 2

Author: @SierraKen
Source: qb64.org Forum
URL: https://www.qb64.org/forum/index.php?topic=1537.msg107553#msg107553
Version: July 27, 2019
Tags: [Shooter], [Graphics], [Audio]

Description:
This game is a challenge where you try to shoot the enemies. It's also hard to keep away from them firing as well. After working on it for many hours non-stop, I made probably my best game I ever made: so have fun with the game.

Controls:
* Arrow keys: Movement
* Space Bar: Fire

Source Code:
Code: QB64: [Select]
  1.     'Tech Invaders 2
  2.     'Game made on July 27, 2019
  3.     'By Ken G.
  4.     'Freeware
  5.     '---------------------------------------------------------------------------------------------------------------------------------------
  6.     'Directions:
  7.     'Move your shooter with the left and right arrow keys and press the space bar to fire at the enemies above.
  8.     'The up and down arrow keys make your shooter stop moving.
  9.     'Esc key ends at anytime.
  10.     'After a couple of rounds, there is the Boss to destroy, which has a health bar that shrinks when you hit him.
  11.     '---------------------------------------------------------------------------------------------------------------------------------------
  12.     'I have put some descriptions in the code below to make it easier to learn from.
  13.     '
  14.     begin:
  15.     DIM NAME$(50), nm$(50), score(50), sccc(50)
  16.     _TITLE "Tech Invaders 2"
  17.     CLS
  18.     SCREEN _NEWIMAGE(800, 600, 32)
  19.     PRINT: PRINT: PRINT
  20.     FOR tt = 79 TO 34 STEP -1
  21.         LOCATE 3, tt + 1: PRINT " "
  22.         LOCATE 3, tt: PRINT "T"
  23.         _DELAY .03
  24.     NEXT tt
  25.     FOR ee = 79 TO 36 STEP -1
  26.         LOCATE 3, ee + 1: PRINT " "
  27.         LOCATE 3, ee: PRINT "E"
  28.         _DELAY .03
  29.     NEXT ee
  30.     FOR cc = 79 TO 38 STEP -1
  31.         LOCATE 3, cc + 1: PRINT " "
  32.         LOCATE 3, cc: PRINT "C"
  33.         _DELAY .03
  34.     NEXT cc
  35.     FOR hh = 79 TO 40 STEP -1
  36.         LOCATE 3, hh + 1: PRINT " "
  37.         LOCATE 3, hh: PRINT "H"
  38.         _DELAY .03
  39.     NEXT hh
  40.     FOR II = 79 TO 47 STEP -1
  41.         LOCATE 3, II + 1: PRINT " "
  42.         LOCATE 3, II: PRINT "I"
  43.         _DELAY .03
  44.     NEXT II
  45.     FOR NN = 79 TO 49 STEP -1
  46.         LOCATE 3, NN + 1: PRINT " "
  47.         LOCATE 3, NN: PRINT "N"
  48.         _DELAY .03
  49.     NEXT NN
  50.     FOR VV = 79 TO 51 STEP -1
  51.         LOCATE 3, VV + 1: PRINT " "
  52.         LOCATE 3, VV: PRINT "V"
  53.         _DELAY .03
  54.     NEXT VV
  55.     FOR AA = 79 TO 53 STEP -1
  56.         LOCATE 3, AA + 1: PRINT " "
  57.         LOCATE 3, AA: PRINT "A"
  58.         _DELAY .03
  59.     NEXT AA
  60.     FOR DD = 79 TO 55 STEP -1
  61.         LOCATE 3, DD + 1: PRINT " "
  62.         LOCATE 3, DD: PRINT "D"
  63.         _DELAY .03
  64.     NEXT DD
  65.     FOR EE2 = 79 TO 57 STEP -1
  66.         LOCATE 3, EE2 + 1: PRINT " "
  67.         LOCATE 3, EE2: PRINT "E"
  68.         _DELAY .03
  69.     NEXT EE2
  70.     FOR RR = 79 TO 59 STEP -1
  71.         LOCATE 3, RR + 1: PRINT " "
  72.         LOCATE 3, RR: PRINT "R"
  73.         _DELAY .03
  74.     NEXT RR
  75.     FOR ss = 79 TO 61 STEP -1
  76.         LOCATE 3, ss + 1: PRINT " "
  77.         LOCATE 3, ss: PRINT "S"
  78.         _DELAY .03
  79.     NEXT ss
  80.     DD = 0
  81.     PRINT: PRINT: PRINT
  82.     PRINT "                                         T W O"
  83.     PRINT: PRINT: PRINT
  84.     PRINT "                                        by Ken G."
  85.     PRINT: PRINT: PRINT
  86.     PRINT "                       Use left and right arrow keys to move back and forth."
  87.     PRINT "                            Use up or down arrow keys to stop moving."
  88.     PRINT "                                    Use space bar to fire."
  89.     PRINT "                                      Esc to end anytime."
  90.     PRINT: PRINT: PRINT
  91.     INPUT "                                   Press Enter to start.", start$
  92.     CLS
  93.     e1 = 0
  94.     E2 = 0
  95.     e3 = 0
  96.     lives = 5
  97.     points = 0
  98.     ushoot = 0
  99.     shooting = 0
  100.     level = 1
  101.     level2 = 1
  102.     start = 0
  103.     s = 0
  104.     xt = 400
  105.     yt = 560
  106.     B = 0
  107.     boss = 0
  108.      
  109.     'Draw your shooter.
  110.     FOR sz = .25 TO 10 STEP .25
  111.         CIRCLE (xt + 10, yt), sz, _RGB32(139, 249, 255)
  112.     NEXT sz
  113.     LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(139, 249, 255), BF
  114.      
  115.     OPENINGSOUND
  116.      
  117.     'This is the start of the main loop.
  118.     go:
  119.     'Choose a random place for the enemy.
  120.      
  121.     IF e1 = 0 AND E2 = 0 AND e3 = 0 THEN
  122.         RANDOMIZE TIMER
  123.         xx = INT(RND * 200) + 100
  124.         RANDOMIZE TIMER
  125.         yy = INT(RND * 100) + 40
  126.         RANDOMIZE TIMER
  127.         xx2 = INT(RND * 200) + 200
  128.         RANDOMIZE TIMER
  129.         yy2 = INT(RND * 100) + 40
  130.         RANDOMIZE TIMER
  131.         xx3 = INT(RND * 200) + 250
  132.         RANDOMIZE TIMER
  133.         yy3 = INT(RND * 100) + 40
  134.     END IF
  135.      
  136.     'Each level has its own loop so it can set a different equation and speed of the enemy.
  137.      
  138.     IF level = 1 THEN
  139.         c1 = 128: c2 = 127: c3 = 255
  140.         one:
  141.         'sec is not time, it's related to the coordinate of the enemy and speed it goes related to the loop speed.
  142.         sec = sec + .02
  143.         s = (60 - sec) * 6 + 180
  144.         x = INT(SIN(s / 180 * 3.141592) * 180) + 325
  145.         y = INT(COS(s / 180 * 3.141592) * 180) + 225
  146.         x3 = INT(SIN(s / 180 * 3.141592) * 180) + 325
  147.         y3 = INT(COS(s / 180 * 3.141592) * 180) + 225
  148.         x4 = INT(SIN(s / 180 * 3.141592) * 180) + 325
  149.         y4 = INT(COS(s / 180 * 3.141592) * 180) + 225
  150.      
  151.         'GOSUB to drawing draws the enemy robot.
  152.         IF e1 <> 1 THEN GOSUB drawing:
  153.         IF E2 <> 1 THEN GOSUB drawing3:
  154.         IF e3 <> 1 THEN GOSUB drawing4:
  155.         _DELAY .006
  156.         GOSUB ERASE:
  157.         IF sec > 180 THEN
  158.             sec = 0
  159.             GOTO onedone:
  160.         END IF
  161.      
  162.         'GOSUB's go to keyboard control and enemy shooting.
  163.         GOSUB keyboard:
  164.         GOSUB shoot:
  165.         GOSUB youshoot2:
  166.         GOTO one:
  167.         onedone:
  168.     END IF
  169.      
  170.     'This level uses the spiral equation so it's a bit different than the others.
  171.     IF level = 2 THEN
  172.         c1 = 127: c2 = 216: c3 = 127
  173.         xx = 400: yy = 300
  174.         xx2 = 100: yy2 = 300
  175.         xx3 = 600: yy3 = 300
  176.         FOR D = 160 TO 0 STEP -.125
  177.             _LIMIT 1000
  178.             s = s + .2
  179.             x = COS(s * 3.141592 / 180) * D
  180.             y = SIN(s * 3.151492 / 180) * D
  181.             x3 = COS(s * 3.141592 / 180) * D
  182.             y3 = SIN(s * 3.151492 / 180) * D
  183.             x4 = COS(s * 3.141592 / 180) * D
  184.             y4 = SIN(s * 3.151492 / 180) * D
  185.             IF e1 <> 1 THEN GOSUB drawing:
  186.             IF E2 <> 1 THEN GOSUB drawing3:
  187.             IF e3 <> 1 THEN GOSUB drawing4:
  188.             _DELAY .006
  189.             GOSUB ERASE:
  190.             GOSUB keyboard:
  191.             GOSUB shoot:
  192.             GOSUB youshoot2:
  193.         NEXT D
  194.         FOR D = 0 TO 160 STEP .125
  195.             _LIMIT 1000
  196.             s = s - .2
  197.             x = COS(s * 3.141592 / 180) * D
  198.             y = SIN(s * 3.151492 / 180) * D
  199.             x3 = COS(s * 3.141592 / 180) * D
  200.             y3 = SIN(s * 3.151492 / 180) * D
  201.             x4 = COS(s * 3.141592 / 180) * D
  202.             y4 = SIN(s * 3.151492 / 180) * D
  203.             IF e1 <> 1 THEN GOSUB drawing:
  204.             IF E2 <> 1 THEN GOSUB drawing3:
  205.             IF e3 <> 1 THEN GOSUB drawing4:
  206.             _DELAY .006
  207.             GOSUB ERASE:
  208.             GOSUB keyboard:
  209.             GOSUB shoot:
  210.             GOSUB youshoot2:
  211.         NEXT D
  212.     END IF
  213.      
  214.     IF level = 3 THEN
  215.         c1 = 255: c2 = 0: c3 = 0
  216.         three:
  217.         sec = sec + .02
  218.         s = (60 - sec) * 6 + 180
  219.         x = INT(SIN(s / 90 * 3.141592) * 180) + 325
  220.         y = INT(COS(s / 180 * 3.141592) * 180) + 225
  221.         x3 = INT(SIN(s / 90 * 3.141592) * 180) + 325
  222.         y3 = INT(COS(s / 180 * 3.141592) * 180) + 225
  223.         x4 = INT(SIN(s / 90 * 3.141592) * 180) + 325
  224.         y4 = INT(COS(s / 180 * 3.141592) * 180) + 225
  225.         IF e1 <> 1 THEN GOSUB drawing:
  226.         IF E2 <> 1 THEN GOSUB drawing3:
  227.         IF e3 <> 1 THEN GOSUB drawing4:
  228.         _DELAY .006
  229.         GOSUB ERASE:
  230.         IF sec > 60 THEN
  231.             sec = 0
  232.             GOTO threedone:
  233.         END IF
  234.         GOSUB keyboard:
  235.         GOSUB shoot:
  236.         GOSUB youshoot2:
  237.         GOTO three:
  238.         threedone:
  239.     END IF
  240.      
  241.     IF level = 4 THEN
  242.         c1 = 255: c2 = 255: c3 = 127
  243.         four:
  244.         sec = sec + .02
  245.         s = (60 - sec) * 6 + 180
  246.         x = INT(SIN(s / 180 * 3.141592) * 180) + 325
  247.         y = INT(COS(s / 90 * 3.141592) * 180) + 225
  248.         x3 = INT(SIN(s / 180 * 3.141592) * 180) + 325
  249.         y3 = INT(COS(s / 90 * 3.141592) * 180) + 225
  250.         x4 = INT(SIN(s / 180 * 3.141592) * 180) + 325
  251.         y4 = INT(COS(s / 90 * 3.141592) * 180) + 225
  252.         IF e1 <> 1 THEN GOSUB drawing:
  253.         IF E2 <> 1 THEN GOSUB drawing3:
  254.         IF e3 <> 1 THEN GOSUB drawing4:
  255.         _DELAY .006
  256.         GOSUB ERASE:
  257.         IF sec > 60 THEN
  258.             sec = 0
  259.             GOTO fourdone:
  260.         END IF
  261.         GOSUB keyboard:
  262.         GOSUB shoot:
  263.         GOSUB youshoot2:
  264.         GOTO four:
  265.         fourdone:
  266.     END IF
  267.     IF level = 5 THEN
  268.         c1 = 133: c2 = 28: c3 = 255
  269.         five:
  270.         sec = sec + .02
  271.         s = (60 - sec) * 6 + 180
  272.         x = INT(SIN(s / 135 * 3.141592) * 180) + 325
  273.         y = INT(COS(s / 33.75 * 3.141592) * 180) + 225
  274.         x3 = INT(SIN(s / 135 * 3.141592) * 180) + 325
  275.         y3 = INT(COS(s / 33.75 * 3.141592) * 180) + 225
  276.         x4 = INT(SIN(s / 135 * 3.141592) * 180) + 325
  277.         y4 = INT(COS(s / 33.75 * 3.141592) * 180) + 225
  278.         IF e1 <> 1 THEN GOSUB drawing:
  279.         IF E2 <> 1 THEN GOSUB drawing3:
  280.         IF e3 <> 1 THEN GOSUB drawing4:
  281.         _DELAY .006
  282.         GOSUB ERASE:
  283.         IF sec > 60 THEN
  284.             sec = 0
  285.             GOTO fivedone:
  286.         END IF
  287.         GOSUB keyboard:
  288.         GOSUB shoot:
  289.         GOSUB youshoot2:
  290.         GOTO five:
  291.         fivedone:
  292.     END IF
  293.      
  294.     IF level = 6 THEN
  295.         e1 = 0: E2 = 1: e3 = 1
  296.         boss = 1
  297.         c1 = 255: c2 = 0: c3 = 0
  298.         six:
  299.         sec = sec + .02
  300.         s = (60 - sec) * 6 + 180
  301.         x = INT(SIN(s / 45 * 3.141592) * 180) + 325
  302.         y = INT(COS(s / 360 * 3.141592) * 180) + 225
  303.         GOSUB drawing2:
  304.         IF sec > 120 THEN
  305.             sec = 0
  306.             GOTO sixdone:
  307.         END IF
  308.         GOSUB keyboard:
  309.         GOSUB shoot:
  310.         GOSUB youshoot2:
  311.         GOTO six:
  312.         sixdone:
  313.     END IF
  314.     IF level = 7 THEN level = 1
  315.     GOTO go:
  316.     'GOTO goes back to the start of the main loop.
  317.      
  318.     'Draws the enemy tank and erases it for animation.
  319.     drawing:
  320.     x2 = x + xx: y2 = y + yy
  321.      
  322.     FOR t = 15 TO 20 STEP .25
  323.         CIRCLE (x2, y2), t, _RGB32(0, 255, 255)
  324.     NEXT t
  325.     FOR t = .25 TO 15 STEP .25
  326.         CIRCLE (x2, y2), t, _RGB32(c1, c2, c3)
  327.     NEXT t
  328.     FOR t = .25 TO 3 STEP .25
  329.         CIRCLE (x2 - 10, y2 - 5), t, _RGB32(0, 255, 255)
  330.         CIRCLE (x2 + 10, y2 - 5), t, _RGB32(0, 255, 255)
  331.         CIRCLE (x2, y2 + 10), t, _RGB32(0, 255, 255)
  332.     NEXT t
  333.     RETURN
  334.      
  335.     drawing3:
  336.     x5 = x3 + xx2: y5 = y3 + yy2
  337.      
  338.     FOR t = 15 TO 20 STEP .25
  339.         CIRCLE (x5, y5), t, _RGB32(0, 255, 255)
  340.     NEXT t
  341.     FOR t = .25 TO 15 STEP .25
  342.         CIRCLE (x5, y5), t, _RGB32(c1, c2, c3)
  343.     NEXT t
  344.     FOR t = .25 TO 3 STEP .25
  345.         CIRCLE (x5 - 10, y5 - 5), t, _RGB32(0, 255, 255)
  346.         CIRCLE (x5 + 10, y5 - 5), t, _RGB32(0, 255, 255)
  347.         CIRCLE (x5, y5 + 10), t, _RGB32(0, 255, 255)
  348.     NEXT t
  349.     RETURN
  350.      
  351.     drawing4:
  352.     x6 = x4 + xx3: y6 = y4 + yy3
  353.      
  354.     FOR t = 15 TO 20 STEP .25
  355.         CIRCLE (x6, y6), t, _RGB32(0, 255, 255)
  356.     NEXT t
  357.     FOR t = .25 TO 15 STEP .25
  358.         CIRCLE (x6, y6), t, _RGB32(c1, c2, c3)
  359.     NEXT t
  360.     FOR t = .25 TO 3 STEP .25
  361.         CIRCLE (x6 - 10, y6 - 5), t, _RGB32(0, 255, 255)
  362.         CIRCLE (x6 + 10, y6 - 5), t, _RGB32(0, 255, 255)
  363.         CIRCLE (x6, y6 + 10), t, _RGB32(0, 255, 255)
  364.     NEXT t
  365.     RETURN
  366.      
  367.     ERASE:
  368.     IF e1 = 0 THEN
  369.         FOR t = .25 TO 20 STEP .25
  370.             CIRCLE (x2, y2), t, _RGB32(0, 0, 0)
  371.         NEXT t
  372.     END IF
  373.     IF E2 = 0 THEN
  374.         FOR t = .25 TO 20 STEP .25
  375.             CIRCLE (x5, y5), t, _RGB32(0, 0, 0)
  376.         NEXT t
  377.     END IF
  378.     IF e3 = 0 THEN
  379.         FOR t = .25 TO 20 STEP .25
  380.             CIRCLE (x6, y6), t, _RGB32(0, 0, 0)
  381.         NEXT t
  382.     END IF
  383.     RETURN
  384.      
  385.     'Draws the Boss Robot.
  386.     drawing2:
  387.     x2 = x + xx: y2 = y + yy
  388.     LINE (x2 - 10, y2 - 10)-(x2 + 10, y2 + 10), _RGB32(0, 255, 0), BF
  389.     LINE (x2 - 2, y2 + 10)-(x2 + 2, y2 + 15), _RGB32(0, 255, 0), BF
  390.     LINE (x2 - 10, y2 + 15)-(x2 + 10, y2 + 25), _RGB32(0, 255, 0), BF
  391.     FOR sz = .25 TO 3 STEP .25
  392.         CIRCLE (x2 - 5, y2 - 5), sz, _RGB32(0, 0, 0)
  393.         CIRCLE (x2 + 5, y2 - 5), sz, _RGB32(0, 0, 0)
  394.     NEXT sz
  395.     LINE (x2 - 5, y2 + 4)-(x2 + 5, y2 + 8), _RGB32(0, 0, 0), BF
  396.     _DELAY .004
  397.     LINE (x2 - 10, y2 - 10)-(x2 + 10, y2 + 10), _RGB32(0, 0, 0), BF
  398.     LINE (x2 - 2, y2 + 10)-(x2 + 2, y2 + 15), _RGB32(0, 0, 0), BF
  399.     LINE (x2 - 10, y2 + 15)-(x2 + 10, y2 + 25), _RGB32(0, 0, 0), BF
  400.     RETURN
  401.      
  402.     'Keyboard control for your movement and shooting.
  403.     keyboard:
  404.     _LIMIT 1000
  405.     a$ = INKEY$
  406.     IF a$ = CHR$(27) THEN END
  407.     IF a$ = CHR$(0) + CHR$(77) THEN r = 1: l = 0
  408.     IF r = 1 THEN
  409.         FOR sz = .25 TO 10 STEP .25
  410.             CIRCLE (xt + 10, yt), sz, _RGB32(0, 0, 0)
  411.         NEXT sz
  412.         LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(0, 0, 0), BF
  413.         xt = xt + 1
  414.         IF xt > 780 THEN xt = 780
  415.         FOR sz = .25 TO 10 STEP .25
  416.             CIRCLE (xt + 10, yt), sz, _RGB32(139, 249, 255)
  417.         NEXT sz
  418.         LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(139, 249, 255), BF
  419.     END IF
  420.     IF a$ = CHR$(0) + CHR$(75) THEN l = 1: r = 0
  421.     IF l = 1 THEN
  422.         FOR sz = .25 TO 10 STEP .25
  423.             CIRCLE (xt + 10, yt), sz, _RGB32(0, 0, 0)
  424.         NEXT sz
  425.         LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(0, 0, 0), BF
  426.         xt = xt - 1
  427.         IF xt < 0 THEN xt = 0
  428.         FOR sz = .25 TO 10 STEP .25
  429.             CIRCLE (xt + 10, yt), sz, _RGB32(139, 249, 255)
  430.         NEXT sz
  431.         LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(139, 249, 255), BF
  432.     END IF
  433.     IF a$ = CHR$(0) + CHR$(72) OR a$ = CHR$(0) + CHR$(80) THEN
  434.         r = 0: l = 0
  435.     END IF
  436.      
  437.     IF a$ = " " THEN GOSUB youshoot:
  438.     RETURN
  439.      
  440.     'The start of your shot.
  441.     youshoot:
  442.     _LIMIT 1000
  443.      
  444.     'sx2 and sy2 are your shot coordinates.
  445.     IF ushoot = 0 THEN
  446.         sx2 = xt + 10
  447.         sy2 = yt - 20
  448.         ushoot = 1
  449.         SOUND 400, .5
  450.     END IF
  451.     RETURN
  452.      
  453.     'The drawing and movement of your shot and if it reaches the enemy.
  454.     youshoot2:
  455.     _LIMIT 1000
  456.     IF ushoot = 1 THEN
  457.         FOR sz = .25 TO 5 STEP .25
  458.             CIRCLE (sx2, sy2), sz, _RGB32(0, 0, 0)
  459.         NEXT sz
  460.         sy2 = sy2 - 3
  461.         IF sy2 < 0 THEN ushoot = 0: RETURN
  462.         FOR szz = .25 TO 5 STEP .25
  463.             CIRCLE (sx2, sy2), szz, _RGB32(255, 0, 0)
  464.         NEXT szz
  465.         IF sx2 > x2 - 21 AND sx2 < x2 + 41 AND sy2 > y2 - 11 AND sy2 < y2 + 21 AND e1 = 0 AND boss = 0 THEN
  466.             ENEMYEXPLOSION sx2, sy2, x2, y2, sx, sy
  467.             FOR sz = .25 TO 5 STEP .25
  468.                 CIRCLE (sx2, sy2), sz, _RGB32(0, 0, 0)
  469.             NEXT sz
  470.             GOSUB redrawshooter:
  471.             points = points + 100
  472.             e1 = 1
  473.             IF e1 = 1 AND E2 = 1 AND e3 = 1 THEN
  474.                 level = level + 1
  475.                 level2 = level2 + 1
  476.                 e1 = 0: E2 = 0: e3 = 0
  477.             END IF
  478.             lives$ = STR$(lives)
  479.             points$ = STR$(points)
  480.             level$ = STR$(level2)
  481.             _TITLE "Tech Invaders 2      Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  482.             ushoot = 0
  483.             GOTO go:
  484.         END IF
  485.         IF sx2 > x5 - 21 AND sx2 < x5 + 41 AND sy2 > y5 - 11 AND sy2 < y5 + 21 AND E2 = 0 AND boss = 0 THEN
  486.             ENEMYEXPLOSION2 sx2, sy2, x5, y5, sx3, sy3
  487.             FOR sz = .25 TO 5 STEP .25
  488.                 CIRCLE (sx2, sy2), sz, _RGB32(0, 0, 0)
  489.             NEXT sz
  490.             GOSUB redrawshooter:
  491.             points = points + 100
  492.             E2 = 1
  493.             IF e1 = 1 AND E2 = 1 AND e3 = 1 THEN
  494.                 level = level + 1
  495.                 level2 = level2 + 1
  496.                 e1 = 0: E2 = 0: e3 = 0
  497.             END IF
  498.             lives$ = STR$(lives)
  499.             points$ = STR$(points)
  500.             level$ = STR$(level2)
  501.             _TITLE "Tech Invaders 2      Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  502.             ushoot = 0
  503.             GOTO go:
  504.         END IF
  505.         IF sx2 > x6 - 21 AND sx2 < x6 + 41 AND sy2 > y6 - 11 AND sy2 < y6 + 21 AND e3 = 0 AND boss = 0 THEN
  506.             ENEMYEXPLOSION3 sx2, sy2, x6, y6, sx4, sy4
  507.             FOR sz = .25 TO 5 STEP .25
  508.                 CIRCLE (sx2, sy2), sz, _RGB32(0, 0, 0)
  509.             NEXT sz
  510.             GOSUB redrawshooter:
  511.             points = points + 100
  512.             e3 = 1
  513.             IF e1 = 1 AND E2 = 1 AND e3 = 1 THEN
  514.                 level = level + 1
  515.                 level2 = level2 + 1
  516.                 e1 = 0: E2 = 0: e3 = 0
  517.             END IF
  518.             lives$ = STR$(lives)
  519.             points$ = STR$(points)
  520.             level$ = STR$(level2)
  521.             _TITLE "Tech Invaders 2     Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  522.             ushoot = 0
  523.             GOTO go:
  524.         END IF
  525.      
  526.         'To see if you hit the Boss.
  527.         IF sx2 > x2 - 21 AND sx2 < x2 + 41 AND sy2 > y2 - 11 AND sy2 < y2 + 21 AND e1 = 0 AND boss = 1 THEN
  528.             B = B + 1
  529.             BB = 10 - B
  530.             LOCATE 3, 3: PRINT "BOSS ROBOT:"
  531.             IF bx = 0 THEN GOTO bxx:
  532.             LINE (150, 30)-(bx + 150, 50), _RGB32(0, 0, 0), BF
  533.             bxx:
  534.             bx = BB * 10
  535.             IF bx < 0 THEN GOTO bxx2:
  536.             LINE (150, 30)-(bx + 150, 50), _RGB32(227, 0, 0), BF
  537.             bxx2:
  538.             SOUND 100, 1
  539.             points = points + 100
  540.             lives$ = STR$(lives)
  541.             points$ = STR$(points)
  542.             level$ = STR$(level2)
  543.             _TITLE "Tech Invaders 2     Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  544.             FOR sz = .25 TO 5 STEP .25
  545.                 CIRCLE (sx2, sy2), sz, _RGB32(0, 0, 0)
  546.             NEXT sz
  547.             IF B > 10 THEN ENEMYEXPLOSION sx2, sy2, x2, y2, sx, sy
  548.             IF B < 11 THEN ushoot = 0: RETURN
  549.             LINE (0, 0)-(800, 200), _RGB32(0, 0, 0), BF
  550.             GOSUB redrawshooter:
  551.             bx = 0
  552.             BB = 0
  553.             B = 0
  554.             boss = 0
  555.             points = points + 1000
  556.             level = level + 1
  557.             level2 = level2 + 1
  558.             e1 = 0: E2 = 0: e3 = 0
  559.             lives$ = STR$(lives)
  560.             points$ = STR$(points)
  561.             level$ = STR$(level2)
  562.             _TITLE "Tech Invaders 2     Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  563.             ushoot = 0
  564.             GOTO go:
  565.         END IF
  566.     END IF
  567.     RETURN
  568.      
  569.     redrawshooter:
  570.     FOR sz = .25 TO 10 STEP .25
  571.         CIRCLE (xt + 10, yt), sz, _RGB32(139, 249, 255)
  572.     NEXT sz
  573.     LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(139, 249, 255), BF
  574.     RETURN
  575.      
  576.     'The enemy's shot and if it reaches you.
  577.     shoot:
  578.     _LIMIT 1000
  579.     IF shooting = 0 AND e1 = 0 THEN
  580.         GOSUB checktoshoot:
  581.         RANDOMIZE TIMER
  582.         sh = INT(RND * 10000) + 1
  583.         IF sh < shh THEN GOTO nexone:
  584.         'sx and sy are the first enemy shot coordinates.
  585.         sx = x2 + 10
  586.         sy = y2 + 10
  587.         shooting = 1
  588.         SOUND 300, .5
  589.     END IF
  590.     nexone:
  591.     IF shooting2 = 0 AND E2 = 0 THEN
  592.         GOSUB checktoshoot:
  593.         RANDOMIZE TIMER
  594.         sh2 = INT(RND * 10000) + 1
  595.         IF sh2 < shh THEN GOTO nexone2:
  596.      
  597.         'sx3 and sy3 are the second enemy shot coordinates.
  598.         sx3 = x5 + 10
  599.         sy3 = y5 + 10
  600.         shooting2 = 1
  601.         SOUND 300, .5
  602.     END IF
  603.     nexone2:
  604.     IF shooting3 = 0 AND e3 = 0 THEN
  605.         GOSUB checktoshoot:
  606.         RANDOMIZE TIMER
  607.         sh3 = INT(RND * 10000) + 1
  608.         IF sh3 < shh THEN GOTO nexone3:
  609.      
  610.         'sx4 and sy4 are the third enemy shot coordinates.
  611.         sx4 = x6 + 10
  612.         sy4 = y6 + 10
  613.         shooting3 = 1
  614.         SOUND 300, .5
  615.     END IF
  616.      
  617.     nexone3:
  618.     'To see if first enemy hit you.
  619.     IF shooting = 1 AND e1 = 0 THEN
  620.         FOR sz2 = .25 TO 5 STEP .25
  621.             CIRCLE (sx, sy), sz2, _RGB32(0, 0, 0)
  622.         NEXT sz2
  623.         sy = sy + 3
  624.         IF sy > 620 THEN shooting = 0: GOTO nex4:
  625.         FOR szz2 = .25 TO 5 STEP .25
  626.             CIRCLE (sx, sy), szz2, _RGB32(255, 0, 0)
  627.         NEXT szz2
  628.         IF sx > xt - 1 AND sx < xt + 21 AND sy > yt - 1 AND sy < yt + 21 THEN
  629.             FOR sz3 = .25 TO 5 STEP .25
  630.                 CIRCLE (sx, sy), sz3, _RGB32(0, 0, 0)
  631.             NEXT sz3
  632.             shooting = 0
  633.             GOSUB explosion:
  634.         END IF
  635.     END IF
  636.     nex4:
  637.      
  638.     'To see if second enemy hit you.
  639.     IF shooting2 = 1 AND E2 = 0 THEN
  640.         FOR sz2 = .25 TO 5 STEP .25
  641.             CIRCLE (sx3, sy3), sz2, _RGB32(0, 0, 0)
  642.         NEXT sz2
  643.         sy3 = sy3 + 3
  644.         IF sy3 > 620 THEN shooting2 = 0: GOTO nexx:
  645.         FOR szz2 = .25 TO 5 STEP .25
  646.             CIRCLE (sx3, sy3), szz2, _RGB32(255, 0, 0)
  647.         NEXT szz2
  648.         IF sx3 > xt - 1 AND sx3 < xt + 21 AND sy3 > yt - 1 AND sy3 < yt + 21 THEN
  649.             FOR sz3 = .25 TO 5 STEP .25
  650.                 CIRCLE (sx3, sy3), sz3, _RGB32(0, 0, 0)
  651.             NEXT sz3
  652.             shooting2 = 0
  653.             GOSUB explosion:
  654.         END IF
  655.     END IF
  656.      
  657.     nexx:
  658.     'To see if third enemy hit you.
  659.     IF shooting3 = 1 AND e3 = 0 THEN
  660.         FOR sz2 = .25 TO 5 STEP .25
  661.             CIRCLE (sx4, sy4), sz2, _RGB32(0, 0, 0)
  662.         NEXT sz2
  663.         sy4 = sy4 + 3
  664.         IF sy4 > 620 THEN shooting3 = 0: RETURN
  665.         FOR szz2 = .25 TO 5 STEP .25
  666.             CIRCLE (sx4, sy4), szz2, _RGB32(255, 0, 0)
  667.         NEXT szz2
  668.         IF sx4 > xt - 1 AND sx4 < xt + 21 AND sy4 > yt - 1 AND sy4 < yt + 21 THEN
  669.             FOR sz3 = .25 TO 5 STEP .25
  670.                 CIRCLE (sx4, sy4), sz3, _RGB32(0, 0, 0)
  671.             NEXT sz3
  672.             shooting3 = 0
  673.             GOSUB explosion:
  674.         END IF
  675.     END IF
  676.     RETURN
  677.      
  678.     explosion:
  679.     FOR sz = .25 TO 10 STEP .25
  680.         CIRCLE (xt + 10, yt), sz, _RGB32(0, 0, 0)
  681.     NEXT sz
  682.     LINE (xt + 8, yt - 7)-(xt + 12, yt - 15), _RGB(0, 0, 0), BF
  683.     SOUND 400, .5
  684.     SOUND 300, .5
  685.     SOUND 200, .5
  686.     SOUND 100, .5
  687.     dxx = (RND * 6) + -3
  688.     dyy = (RND * 6) + -3
  689.     dxx2 = (RND * 6) + -3
  690.     dyy2 = (RND * 6) + -3
  691.     dxx3 = (RND * 6) + -3
  692.     dyy3 = (RND * 6) + -3
  693.     dxx4 = (RND * 6) + -3
  694.     dyy4 = (RND * 6) + -3
  695.     dxx5 = (RND * 6) + -3
  696.     dyy5 = (RND * 6) + -3
  697.     dxx6 = (RND * 6) + -3
  698.     dyy6 = (RND * 6) + -3
  699.     yourexplosion:
  700.     DD = DD + 1
  701.     dxx = dxx + dxx / 4
  702.     dxx2 = dxx2 + dxx2 / 4
  703.     dxx3 = dxx3 + dxx3 / 4
  704.     dxx4 = dxx4 + dxx4 / 4
  705.     dxx5 = dxx5 + dxx5 / 4
  706.     dxx6 = dxx6 + dxx6 / 4
  707.     dyy = dyy + dyy / 4
  708.     dyy2 = dyy2 + dyy2 / 4
  709.     dyy3 = dyy3 + dyy3 / 4
  710.     dyy4 = dyy4 + dyy4 / 4
  711.     dyy5 = dyy5 + dyy5 / 4
  712.     dyy6 = dyy6 + dyy6 / 4
  713.     LINE (xt + dxx, yt + dyy)-(xt + dxx + 2, yt + dyy + 2), _RGB32(255, 0, 0), BF
  714.     LINE (xt + dxx2, yt + dyy2)-(xt + dxx2 + 2, yt + dyy2 + 2), _RGB32(0, 255, 0), BF
  715.     LINE (xt + dxx3, yt + dyy3)-(xt + dxx3 + 2, yt + dyy3 + 2), _RGB32(255, 0, 0), BF
  716.     LINE (xt + dxx4, yt + dyy4)-(xt + dxx4 + 2, yt + dyy4 + 2), _RGB32(0, 255, 0), BF
  717.     LINE (xt + dxx5, yt + dyy5)-(xt + dxx5 + 2, yt + dyy5 + 2), _RGB32(255, 0, 0), BF
  718.     LINE (xt + dxx6, yt + dyy6)-(xt + dxx6 + 2, yt + dyy6 + 2), _RGB32(0, 255, 0), BF
  719.     _DELAY .02
  720.     LINE (xt + dxx, yt + dyy)-(xt + dxx + 2, yt + dyy + 2), _RGB32(0, 0, 0), BF
  721.     LINE (xt + dxx2, yt + dyy2)-(xt + dxx2 + 2, yt + dyy2 + 2), _RGB32(0, 0, 0), BF
  722.     LINE (xt + dxx3, yt + dyy3)-(xt + dxx3 + 2, yt + dyy3 + 2), _RGB32(0, 0, 0), BF
  723.     LINE (xt + dxx4, yt + dyy4)-(xt + dxx4 + 2, yt + dyy4 + 2), _RGB32(0, 0, 0), BF
  724.     LINE (xt + dxx5, yt + dyy5)-(xt + dxx5 + 2, yt + dyy5 + 2), _RGB32(0, 0, 0), BF
  725.     LINE (xt + dxx6, yt + dyy6)-(xt + dxx6 + 2, yt + dyy6 + 2), _RGB32(0, 0, 0), BF
  726.     IF DD > 20 THEN GOTO back2:
  727.     GOTO yourexplosion:
  728.     back2:
  729.     DD = 0
  730.     lives = lives - 1
  731.     lives$ = STR$(lives)
  732.     points$ = STR$(points)
  733.     level$ = STR$(level2)
  734.     _TITLE "Tech Invaders 2     Lives: " + lives$ + "     Level: " + level$ + "      Score: " + points$
  735.     LINE (xt - 22, yt - 42)-(xt + 42, yt + 42), _RGB32(0, 0, 0), BF
  736.     GOSUB redrawshooter:
  737.     IF lives = 0 THEN
  738.         LOCATE 20, 40: PRINT "G A M E   O V E R"
  739.         LOCATE 22, 40: PRINT "Score: "; points
  740.         LOCATE 23, 40: PRINT "Level: "; level2
  741.         LOCATE 25, 40: INPUT "Press Enter to go to Top Ten Scores.", tt$
  742.      
  743.         'Top Ten Scores
  744.         scc = points
  745.         IF _FILEEXISTS("toptentech.txt") THEN
  746.         ELSE
  747.             OPEN "toptentech.txt" FOR OUTPUT AS #1
  748.             RESTORE originaltopten
  749.             DO
  750.                 READ toptenname$, toptenscore!
  751.                 IF toptenname$ = "EOF" THEN EXIT DO
  752.                 PRINT #1, toptenname$
  753.                 PRINT #1, toptenscore!
  754.             LOOP
  755.             CLOSE #1
  756.         END IF
  757.      
  758.         OPEN "toptentech.txt" FOR INPUT AS #1
  759.         FOR n = 1 TO 10
  760.             INPUT #1, NAME$(n)
  761.             INPUT #1, score(n)
  762.             IF scc > score(n) AND sct = 0 THEN
  763.                 NN = n
  764.                 PRINT "You have made the Top Ten!"
  765.                 typename:
  766.                 INPUT "Type your name here (25 letters and spaces maximum.):", nm$(NN)
  767.                 IF LEN(nm$(NN)) > 25 THEN
  768.                     PRINT "Name too long, try again."
  769.                     GOTO typename:
  770.                 END IF
  771.                 sccc(NN) = scc
  772.                 sct = 1
  773.             END IF
  774.             IF n = 10 AND sct = 0 THEN CLOSE #1: GOTO nex7:
  775.         NEXT n
  776.         CLOSE #1
  777.         nex5:
  778.         CLOSE #1
  779.         OPEN "toptentech.txt" FOR OUTPUT AS #1
  780.         FOR n = 1 TO NN
  781.             IF n <> NN THEN PRINT #1, NAME$(n): PRINT #1, score(n)
  782.             IF n = NN THEN
  783.                 PRINT #1, nm$(n)
  784.                 PRINT #1, sccc(n)
  785.             END IF
  786.         NEXT n
  787.         nex6:
  788.         FOR n = NN TO 10
  789.             PRINT #1, NAME$(n): PRINT #1, score(n)
  790.         NEXT n
  791.         CLOSE #1
  792.         nex7:
  793.         CLS
  794.         PRINT: PRINT: PRINT
  795.         PRINT "                                         T O P    T E N "
  796.         PRINT: PRINT: PRINT
  797.         OPEN "toptentech.txt" FOR INPUT AS #1
  798.         FOR n = 1 TO 10
  799.             IF EOF(1) THEN GOTO nex8:
  800.             INPUT #1, NAME$(n)
  801.             INPUT #1, score(n)
  802.             PRINT "             "; n; ". "; NAME$(n); score(n)
  803.         NEXT n
  804.         nex8:
  805.         CLOSE #1
  806.         FOR n = 1 TO 10
  807.             nm$(n) = ""
  808.             score(n) = 0
  809.             NAME$(n) = ""
  810.             sccc(n) = 0
  811.         NEXT n
  812.         NN = 0
  813.         n = 0
  814.         sct = 0
  815.         scc = 0
  816.         LOCATE 23, 1
  817.         INPUT "Would you like to play again? (Yes/No)", ag$
  818.         IF ag$ = "y" OR ag$ = "Y" OR ag$ = "YES" OR ag$ = "yes" OR ag$ = "Yes" OR ag$ = "yES" OR ag$ = "yeS" OR ag$ = "YEs" THEN GOTO begin:
  819.         END
  820.     END IF
  821.     OPENINGSOUND
  822.     RETURN
  823.      
  824.     checktoshoot:
  825.     IF level2 = 1 THEN shh = 9950
  826.     IF level2 = 2 THEN shh = 9945
  827.     IF level2 = 3 THEN shh = 9940
  828.     IF level2 = 4 THEN shh = 9935
  829.     IF level2 = 5 THEN shh = 9930
  830.     IF level2 = 6 THEN shh = 9925
  831.     IF level2 > 6 THEN shh = 9920
  832.     RETURN
  833.      
  834.     originaltopten:
  835.     DATA Space Ace,7000
  836.     DATA Suzy Swift,6000
  837.     DATA Speedy Spencer,5000
  838.     DATA Super Sam,4000
  839.     DATA Battery Bob,3000
  840.     DATA Karen Kryptonite,2750
  841.     DATA Quick Ken,2500
  842.     DATA Tiger Tessa,2250
  843.     DATA Arcade Joe,2000
  844.     DATA How DO U PLAY,1750
  845.     DATA EOF,0
  846.      
  847.     SUB OPENINGSOUND
  848.         snd = 300
  849.         snd2 = 800
  850.         FOR t = 1 TO 50
  851.             IF snd > 800 THEN snd = 300
  852.             IF snd2 < 300 THEN snd2 = 800
  853.             snd = snd + 10
  854.             SOUND snd, .25
  855.         NEXT t
  856.     END SUB
  857.      
  858.     SUB ENEMYEXPLOSION (sx2, sy2, x2, y2, sx, sy)
  859.         FOR sz4 = .25 TO 5 STEP .25
  860.             CIRCLE (sx2, sy2), sz4, _RGB32(0, 0, 0)
  861.         NEXT sz4
  862.         SOUND 400, .5
  863.         SOUND 300, .5
  864.         SOUND 200, .5
  865.         SOUND 100, .5
  866.         RANDOMIZE TIMER
  867.         dxx = (RND * 6) + -3
  868.         RANDOMIZE TIMER
  869.         dyy = (RND * 6) + -3
  870.         RANDOMIZE TIMER
  871.         dxx2 = (RND * 6) + -3
  872.         RANDOMIZE TIMER
  873.         dyy2 = (RND * 6) + -3
  874.         RANDOMIZE TIMER
  875.         dxx3 = (RND * 6) + -3
  876.         RANDOMIZE TIMER
  877.         dyy3 = (RND * 6) + -3
  878.         RANDOMIZE TIMER
  879.         dxx4 = (RND * 6) + -3
  880.         RANDOMIZE TIMER
  881.         dyy4 = (RND * 6) + -3
  882.         RANDOMIZE TIMER
  883.         dxx5 = (RND * 6) + -3
  884.         RANDOMIZE TIMER
  885.         dyy5 = (RND * 6) + -3
  886.         RANDOMIZE TIMER
  887.         dxx6 = (RND * 6) + -3
  888.         RANDOMIZE TIMER
  889.         dyy6 = (RND * 6) + -3
  890.         explosion1:
  891.         dd = dd + 1
  892.         dxx = dxx + dxx / 4
  893.         dxx2 = dxx2 + dxx2 / 4
  894.         dxx3 = dxx3 + dxx3 / 4
  895.         dxx4 = dxx4 + dxx4 / 4
  896.         dxx5 = dxx5 + dxx5 / 4
  897.         dxx6 = dxx6 + dxx6 / 4
  898.         dyy = dyy + dyy / 4
  899.         dyy2 = dyy2 + dyy2 / 4
  900.         dyy3 = dyy3 + dyy3 / 4
  901.         dyy4 = dyy4 + dyy4 / 4
  902.         dyy5 = dyy5 + dyy5 / 4
  903.         dyy6 = dyy6 + dyy6 / 4
  904.         LINE (x2 + dxx, y2 + dyy)-(x2 + dxx + 2, y2 + dyy + 2), _RGB32(255, 0, 0), BF
  905.         LINE (x2 + dxx2, y2 + dyy2)-(x2 + dxx2 + 2, y2 + dyy2 + 2), _RGB32(0, 255, 0), BF
  906.         LINE (x2 + dxx3, y2 + dyy3)-(x2 + dxx3 + 2, y2 + dyy3 + 2), _RGB32(255, 0, 0), BF
  907.         LINE (x2 + dxx4, y2 + dyy4)-(x2 + dxx4 + 2, y2 + dyy4 + 2), _RGB32(0, 255, 0), BF
  908.         LINE (x2 + dxx5, y2 + dyy5)-(x2 + dxx5 + 2, y2 + dyy5 + 2), _RGB32(255, 0, 0), BF
  909.         LINE (x2 + dxx6, y2 + dyy6)-(x2 + dxx6 + 2, y2 + dyy6 + 2), _RGB32(0, 255, 0), BF
  910.         _DELAY .02
  911.         LINE (x2 + dxx, y2 + dyy)-(x2 + dxx + 2, y2 + dyy + 2), _RGB32(0, 0, 0), BF
  912.         LINE (x2 + dxx2, y2 + dyy2)-(x2 + dxx2 + 2, y2 + dyy2 + 2), _RGB32(0, 0, 0), BF
  913.         LINE (x2 + dxx3, y2 + dyy3)-(x2 + dxx3 + 2, y2 + dyy3 + 2), _RGB32(0, 0, 0), BF
  914.         LINE (x2 + dxx4, y2 + dyy4)-(x2 + dxx4 + 2, y2 + dyy4 + 2), _RGB32(0, 0, 0), BF
  915.         LINE (x2 + dxx5, y2 + dyy5)-(x2 + dxx5 + 2, y2 + dyy5 + 2), _RGB32(0, 0, 0), BF
  916.         LINE (x2 + dxx6, y2 + dyy6)-(x2 + dxx6 + 2, y2 + dyy6 + 2), _RGB32(0, 0, 0), BF
  917.         IF dd > 20 THEN GOTO goingback
  918.         GOTO explosion1:
  919.         goingback:
  920.         dd = 0
  921.         LINE (x2 - 21, y2 - 21)-(x2 + 41, y2 + 41), _RGB32(0, 0, 0), BF
  922.         FOR sz4 = .25 TO 5 STEP .25
  923.             CIRCLE (sx2, sy2), sz4, _RGB32(0, 0, 0)
  924.         NEXT sz4
  925.         FOR sz4 = .25 TO 5 STEP .25
  926.             CIRCLE (sx, sy), sz4, _RGB32(0, 0, 0)
  927.         NEXT sz4
  928.     END SUB
  929.      
  930.     SUB ENEMYEXPLOSION2 (sx2, sy2, x5, y5, sx3, sy3)
  931.         FOR sz5 = .25 TO 5 STEP .25
  932.             CIRCLE (sx2, sy2), sz5, _RGB32(0, 0, 0)
  933.         NEXT sz5
  934.         SOUND 400, .5
  935.         SOUND 300, .5
  936.         SOUND 200, .5
  937.         SOUND 100, .5
  938.         RANDOMIZE TIMER
  939.         dxx = (RND * 6) + -3
  940.         RANDOMIZE TIMER
  941.         dyy = (RND * 6) + -3
  942.         RANDOMIZE TIMER
  943.         dxx2 = (RND * 6) + -3
  944.         RANDOMIZE TIMER
  945.         dyy2 = (RND * 6) + -3
  946.         RANDOMIZE TIMER
  947.         dxx3 = (RND * 6) + -3
  948.         RANDOMIZE TIMER
  949.         dyy3 = (RND * 6) + -3
  950.         RANDOMIZE TIMER
  951.         dxx4 = (RND * 6) + -3
  952.         RANDOMIZE TIMER
  953.         dyy4 = (RND * 6) + -3
  954.         RANDOMIZE TIMER
  955.         dxx5 = (RND * 6) + -3
  956.         RANDOMIZE TIMER
  957.         dyy5 = (RND * 6) + -3
  958.         RANDOMIZE TIMER
  959.         dxx6 = (RND * 6) + -3
  960.         RANDOMIZE TIMER
  961.         dyy6 = (RND * 6) + -3
  962.         explosion2:
  963.         dd = dd + 1
  964.         dxx = dxx + dxx / 4
  965.         dxx2 = dxx2 + dxx2 / 4
  966.         dxx3 = dxx3 + dxx3 / 4
  967.         dxx4 = dxx4 + dxx4 / 4
  968.         dxx5 = dxx5 + dxx5 / 4
  969.         dxx6 = dxx6 + dxx6 / 4
  970.         dyy = dyy + dyy / 4
  971.         dyy2 = dyy2 + dyy2 / 4
  972.         dyy3 = dyy3 + dyy3 / 4
  973.         dyy4 = dyy4 + dyy4 / 4
  974.         dyy5 = dyy5 + dyy5 / 4
  975.         dyy6 = dyy6 + dyy6 / 4
  976.         LINE (x5 + dxx, y5 + dyy)-(x5 + dxx + 2, y5 + dyy + 2), _RGB32(255, 0, 0), BF
  977.         LINE (x5 + dxx2, y5 + dyy2)-(x5 + dxx2 + 2, y5 + dyy2 + 2), _RGB32(0, 255, 0), BF
  978.         LINE (x5 + dxx3, y5 + dyy3)-(x5 + dxx3 + 2, y5 + dyy3 + 2), _RGB32(255, 0, 0), BF
  979.         LINE (x5 + dxx4, y5 + dyy4)-(x5 + dxx4 + 2, y5 + dyy4 + 2), _RGB32(0, 255, 0), BF
  980.         LINE (x5 + dxx5, y5 + dyy5)-(x5 + dxx5 + 2, y5 + dyy5 + 2), _RGB32(255, 0, 0), BF
  981.         LINE (x5 + dxx6, y5 + dyy6)-(x5 + dxx6 + 2, y5 + dyy6 + 2), _RGB32(0, 255, 0), BF
  982.         _DELAY .02
  983.         LINE (x5 + dxx, y5 + dyy)-(x5 + dxx + 2, y5 + dyy + 2), _RGB32(0, 0, 0), BF
  984.         LINE (x5 + dxx2, y5 + dyy2)-(x5 + dxx2 + 2, y5 + dyy2 + 2), _RGB32(0, 0, 0), BF
  985.         LINE (x5 + dxx3, y5 + dyy3)-(x5 + dxx3 + 2, y5 + dyy3 + 2), _RGB32(0, 0, 0), BF
  986.         LINE (x5 + dxx4, y5 + dyy4)-(x5 + dxx4 + 2, y5 + dyy4 + 2), _RGB32(0, 0, 0), BF
  987.         LINE (x5 + dxx5, y5 + dyy5)-(x5 + dxx5 + 2, y5 + dyy5 + 2), _RGB32(0, 0, 0), BF
  988.         LINE (x5 + dxx6, y5 + dyy6)-(x5 + dxx6 + 2, y5 + dyy6 + 2), _RGB32(0, 0, 0), BF
  989.         IF dd > 20 THEN GOTO goingback2:
  990.         GOTO explosion2:
  991.         goingback2:
  992.         dd = 0
  993.         LINE (x5 - 21, y5 - 21)-(x5 + 41, y5 + 41), _RGB32(0, 0, 0), BF
  994.         FOR sz5 = .25 TO 5 STEP .25
  995.             CIRCLE (sx2, sy2), sz5, _RGB32(0, 0, 0)
  996.         NEXT sz5
  997.         FOR sz5 = .25 TO 5 STEP .25
  998.             CIRCLE (sx3, sy3), sz5, _RGB32(0, 0, 0)
  999.         NEXT sz5
  1000.     END SUB
  1001.      
  1002.     SUB ENEMYEXPLOSION3 (sx2, sy2, x6, y6, sx4, sy4)
  1003.         FOR sz6 = .25 TO 5 STEP .25
  1004.             CIRCLE (sx2, sy2), sz6, _RGB32(0, 0, 0)
  1005.         NEXT sz6
  1006.         SOUND 400, .5
  1007.         SOUND 300, .5
  1008.         SOUND 200, .5
  1009.         SOUND 100, .5
  1010.         RANDOMIZE TIMER
  1011.         dxx = (RND * 6) + -3
  1012.         RANDOMIZE TIMER
  1013.         dyy = (RND * 6) + -3
  1014.         RANDOMIZE TIMER
  1015.         dxx2 = (RND * 6) + -3
  1016.         RANDOMIZE TIMER
  1017.         dyy2 = (RND * 6) + -3
  1018.         RANDOMIZE TIMER
  1019.         dxx3 = (RND * 6) + -3
  1020.         RANDOMIZE TIMER
  1021.         dyy3 = (RND * 6) + -3
  1022.         RANDOMIZE TIMER
  1023.         dxx4 = (RND * 6) + -3
  1024.         RANDOMIZE TIMER
  1025.         dyy4 = (RND * 6) + -3
  1026.         RANDOMIZE TIMER
  1027.         dxx5 = (RND * 6) + -3
  1028.         RANDOMIZE TIMER
  1029.         dyy5 = (RND * 6) + -3
  1030.         RANDOMIZE TIMER
  1031.         dxx6 = (RND * 6) + -3
  1032.         RANDOMIZE TIMER
  1033.         dyy6 = (RND * 6) + -3
  1034.         explosion3:
  1035.         dd = dd + 1
  1036.         dxx = dxx + dxx / 4
  1037.         dxx2 = dxx2 + dxx2 / 4
  1038.         dxx3 = dxx3 + dxx3 / 4
  1039.         dxx4 = dxx4 + dxx4 / 4
  1040.         dxx5 = dxx5 + dxx5 / 4
  1041.         dxx6 = dxx6 + dxx6 / 4
  1042.         dyy = dyy + dyy / 4
  1043.         dyy2 = dyy2 + dyy2 / 4
  1044.         dyy3 = dyy3 + dyy3 / 4
  1045.         dyy4 = dyy4 + dyy4 / 4
  1046.         dyy5 = dyy5 + dyy5 / 4
  1047.         dyy6 = dyy6 + dyy6 / 4
  1048.         LINE (x6 + dxx, y6 + dyy)-(x6 + dxx + 2, y6 + dyy + 2), _RGB32(255, 0, 0), BF
  1049.         LINE (x6 + dxx2, y6 + dyy2)-(x6 + dxx2 + 2, y6 + dyy2 + 2), _RGB32(0, 255, 0), BF
  1050.         LINE (x6 + dxx3, y6 + dyy3)-(x6 + dxx3 + 2, y6 + dyy3 + 2), _RGB32(255, 0, 0), BF
  1051.         LINE (x6 + dxx4, y6 + dyy4)-(x6 + dxx4 + 2, y6 + dyy4 + 2), _RGB32(0, 255, 0), BF
  1052.         LINE (x6 + dxx5, y6 + dyy5)-(x6 + dxx5 + 2, y6 + dyy5 + 2), _RGB32(255, 0, 0), BF
  1053.         LINE (x6 + dxx6, y6 + dyy6)-(x6 + dxx6 + 2, y6 + dyy6 + 2), _RGB32(0, 255, 0), BF
  1054.         _DELAY .02
  1055.         LINE (x6 + dxx, y6 + dyy)-(x6 + dxx + 2, y6 + dyy + 2), _RGB32(0, 0, 0), BF
  1056.         LINE (x6 + dxx2, y6 + dyy2)-(x6 + dxx2 + 2, y6 + dyy2 + 2), _RGB32(0, 0, 0), BF
  1057.         LINE (x6 + dxx3, y6 + dyy3)-(x6 + dxx3 + 2, y6 + dyy3 + 2), _RGB32(0, 0, 0), BF
  1058.         LINE (x6 + dxx4, y6 + dyy4)-(x6 + dxx4 + 2, y6 + dyy4 + 2), _RGB32(0, 0, 0), BF
  1059.         LINE (x6 + dxx5, y6 + dyy5)-(x6 + dxx5 + 2, y6 + dyy5 + 2), _RGB32(0, 0, 0), BF
  1060.         LINE (x6 + dxx6, y6 + dyy6)-(x6 + dxx6 + 2, y6 + dyy6 + 2), _RGB32(0, 0, 0), BF
  1061.         IF dd > 20 THEN GOTO goingback3:
  1062.         GOTO explosion3:
  1063.         goingback3:
  1064.         dd = 0
  1065.         LINE (x6 - 21, y6 - 21)-(x6 + 41, y6 + 41), _RGB32(0, 0, 0), BF
  1066.         FOR sz5 = .25 TO 5 STEP .25
  1067.             CIRCLE (sx2, sy2), sz5, _RGB32(0, 0, 0)
  1068.         NEXT sz5
  1069.         FOR sz5 = .25 TO 5 STEP .25
  1070.             CIRCLE (sx4, sy4), sz5, _RGB32(0, 0, 0)
  1071.         NEXT sz5
  1072.     END SUB
  1073.