Author Topic: I wanted to do something with strings... so I did  (Read 3995 times)

0 Members and 1 Guest are viewing this topic.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
I wanted to do something with strings... so I did
« on: March 14, 2021, 09:11:38 pm »
Code: QB64: [Select]
  1. _title "Galaxy Grid"
  2.  
  3. TYPE coordinate
  4.     x AS INTEGER
  5.     y AS INTEGER
  6.     f AS INTEGER
  7.  
  8. TYPE typeOfDamage
  9.     ship AS INTEGER
  10.     medical AS INTEGER
  11.  
  12. TYPE StardateLog
  13.     ships AS INTEGER ' a.k.a. lives
  14.     score AS INTEGER
  15.     currentDamage AS typeOfDamage '% -- 100 med is all crew dead or injured, 100 ship is all ship damaged
  16.     totalDamage AS typeOfDamage ' for stats at end of game
  17.     currentSurvivors AS INTEGER ' survivors on board, max is 20
  18.     totalSurvivorsSaved AS INTEGER ' all survivors rescued and dropped off at a colony
  19.     currentMedSupply AS INTEGER ' number of med kits. they are used to heal crew injured
  20.     totalMedSupply AS INTEGER ' for end stats -- total - current is used
  21.     enemiesDestroyed AS INTEGER
  22.     morale AS INTEGER
  23.     totalMorale AS INTEGER
  24.     moves AS INTEGER
  25.  
  26. TYPE gridChar
  27.     code AS INTEGER 'ASCII code
  28.     clr AS INTEGER ' color
  29.  
  30. CONST TRUE = 1
  31. CONST FALSE = 0
  32. CONST selectionBeep = "L20O3C"
  33. CONST errorBeep = "L10O1CO0GEC"
  34. CONST lowBeep = "L60O2B"
  35. CONST movingShipBeep = "L16O0F"
  36. CONST movingShipDelay = 0.05
  37. CONST movingShipMod = 10
  38. CONST hail = "L20O3AAL30O3F"
  39. CONST hailDelay = 1.5 'was 1
  40. CONST returnBeep = "L10O0GA"
  41. CONST beamingBeep = "L60O2CACACACACACAL15O1CCL7O3C"
  42. CONST dockingBeep = "L60O1FCFC"
  43. CONST dockingDelay = 0.15
  44. CONST runOverText = "L32O1G"
  45. CONST printingBeep = "L30O1F"
  46. CONST printingDelay = 0.05
  47. CONST correctBeep = "L8O2DDL32O3C"
  48. CONST shotDelay = 0.03
  49. CONST fireBeep = "L64O3CEGAA"
  50. CONST shipHitBeep = "L64O2EEEEEL16CCL64O1GABABN0N0BAGGAN0N0CEDE"
  51. CONST successBeep = "L9O2DL15DL9DL4F"
  52. CONST medicalRepairBeep = "L32O4CP4CP4CP4CP4CCC"
  53. CONST shipRepairBeep = "L32O2GCGCGCGCGC"
  54. CONST t$ = "�" '  changing this will change all of the block graphics to the constant used
  55.  
  56. ' share everything won't have worry about passing vairables
  57. DIM SHARED grid(1 TO 80, 1 TO 45, 1 TO 3) AS INTEGER
  58. DIM SHARED information$(1 TO 10)
  59. DIM SHARED shipLog AS StardateLog
  60. DIM SHARED Espializer7 AS coordinate
  61. DIM SHARED quizPassed
  62. quizPassed = FALSE
  63. DIM SHARED tabToggle
  64. tabToggle = 1
  65. DIM SHARED shipsInSarienFleet
  66. DIM SHARED fleetJumpsWhenThisReaches0
  67. DIM SHARED gameInProgress
  68. gameInProgress = 0
  69. DIM SHARED beenToMenu
  70. beenToMenu = 0
  71. DIM SHARED blackHole AS gridChar
  72. blackHole.code = 111
  73. blackHole.clr = 8
  74. DIM SHARED wormHole AS gridChar
  75. wormHole.code = 145
  76. wormHole.clr = 5
  77. DIM SHARED otherPlanet AS gridChar
  78. otherPlanet.code = 254
  79. otherPlanet.clr = 13
  80. DIM SHARED wifranColony AS gridChar
  81. wifranColony.code = 223
  82. wifranColony.clr = 9
  83. DIM SHARED disabledShip AS gridChar
  84. disabledShip.code = 15
  85. disabledShip.clr = 12
  86. DIM SHARED Top AS gridChar
  87. Top.code = 244
  88. Top.clr = 15
  89. DIM SHARED Bottom AS gridChar
  90. Bottom.code = 245
  91. Bottom.clr = 15
  92. DIM SHARED informant AS gridChar
  93. informant.code = 213
  94. informant.clr = 6
  95. DIM SHARED esplzr AS gridChar
  96. esplzr.code = 234
  97. esplzr.clr = 11
  98. DIM SHARED sarienFleet AS gridChar
  99. sarienFleet.code = 176
  100. sarienFleet.clr = 2
  101. DIM SHARED sarienShip AS gridChar
  102. sarienShip.code = 224
  103. sarienShip.clr = 2
  104.  
  105.  
  106. ON ERROR GOTO whatHappened
  107. GOTO Beginning
  108. whatHappened:
  109. CALL ClearStatus
  110. COLOR 15, 0
  111. LOCATE 46, 1
  112. PRINT "ERROR. Hit any key to end and begin to code my way out of it."
  113. pause$ = INPUT$(1)
  114.  
  115. Beginning:
  116. WIDTH 80, 50
  117. CALL MainMenu
  118.  
  119. SUB Dedication
  120.     COLOR 10, 1
  121.     CLS
  122.     PRINT
  123.     PRINT
  124.     PRINT LongCenter$("I was introduced to computers by my father at a young age. He showed me a Texas Instruments device that was only a little bit old around 1982. I was still young enough to sit in his lap as we played " + CHR$(34) + "Hunt the Wumpus." + CHR$(34) + " He showed me a program his father had written called Colors. As it was the 80s, the program was saved on a casette tape. All it did was leave a character block trail on the screen of the current color. Not until I was older was I was able to understand some of the code.")
  125.     PRINT
  126.     PRINT LongCenter$("When the Apple IIe was available as state of the art tech my father introduced me to computer code. I remember being facinated that CHR$(27) referred to the Escape key. One of the best things about the IIe was a new video game called King's Quest: The Quest for the Crown. The game was loaded by putting a 5.25 inch disk into the machine. Whoa! Major new tech. Lol. With the success of King's Quest, Sierra published a sequel and then a Space Quest.")
  127.     PRINT
  128.     PRINT LongCenter$("As time went by Sierra published Quest sequels that took advantage of new tech. Through those series, I got to watch the evolution of mouse input, more than 16 colors, sound beyond the PC speaker and eventually VGA grahpics. In spite of the HD graphics and sound today, I still play those old games sometimes (gog.com has them). Because I was born in '77 I'm still in awe of not just the current machines but moreover the evolution of the computer tech as a whole.")
  129.     PRINT
  130.     a$ = "Thanks dad for such an incredicle view."
  131.     LOCATE , GetCenter(a$)
  132.     COLOR 13, 1
  133.     PRINT a$
  134.     PRINT
  135.     PRINT
  136.     a$ = "Push any key to continue."
  137.     LOCATE , 1
  138.     COLOR 14, 1
  139.     PRINT a$
  140.     pause$ = INPUT$(1)
  141.     CALL MainMenu
  142.  
  143. SUB BattleFleet
  144.     CALL Battle(shipsInSarienFleet)
  145.  
  146. SUB SaveGame
  147.     COLOR 14, 10
  148.     CLS
  149.     DIM fileName$(1 TO 5)
  150.     FOR cnt = 1 TO 5
  151.         fileName$(cnt) = "GGSave"
  152.         fileName$(cnt) = fileName$(cnt) + LTRIM$(STR$(cnt))
  153.         fileName$(cnt) = fileName$(cnt) + ".txt"
  154.     NEXT cnt
  155.     COLOR 12, 9
  156.     CLS
  157.     '                                1         2         3         4         5         6         7         8
  158.     '                       12345678901234567890123456789012345678901234567890123456789012345678901234567890
  159.     LOCATE 9, 1
  160.     PRINT "  Slot     Lives     Score     Moves     Morale     Damage     Crew Injured"
  161.     FOR cnt = 1 TO 5
  162.         LOCATE 11 + (cnt * 2), 1
  163.         COLOR 14, 9
  164.         PRINT "    " + LTRIM$(STR$(cnt))
  165.         COLOR 7, 9
  166.         IF _FILEEXISTS(fileName$(cnt)) = 0 THEN
  167.             LOCATE 11 + (cnt * 2), 20
  168.             PRINT "No information"
  169.         ELSE
  170.             OPEN fileName$(cnt) FOR INPUT AS #1
  171.             INPUT #1, espX$
  172.             INPUT #1, espY$
  173.             INPUT #1, shipMoves$
  174.             INPUT #1, shipStat$ 'captainsLog.ships
  175.             INPUT #1, scoreStat$ 'captainsLog.score
  176.             INPUT #1, moraleStat$ 'captainsLog.morale
  177.             INPUT #1, damStat$ 'captainsLog.currentDamage.ship
  178.             INPUT #1, injStat$ 'captainsLog.currentDamage.medical
  179.             CLOSE #1
  180.             LOCATE 11 + (cnt * 2), 13
  181.             PRINT shipStat$
  182.             LOCATE 11 + (cnt * 2), 22
  183.             PRINT scoreStat$
  184.             LOCATE 11 + (cnt * 2), 32
  185.             PRINT shipMoves$
  186.             LOCATE 11 + (cnt * 2), 42
  187.             PRINT moraleStat$
  188.             LOCATE 11 + (cnt * 2), 53
  189.             PRINT USING "##%"; VAL(damStat$)
  190.             LOCATE 11 + (cnt * 2), 65
  191.             PRINT USING "##%"; VAL(injStat$)
  192.         END IF
  193.     NEXT cnt
  194.  
  195.     a$ = "Which save slot? "
  196.     COLOR 10, 9
  197.     LOCATE 24, GetCenter(a$)
  198.     PRINT a$;
  199.     DO
  200.         choice$ = INPUT$(1)
  201.         IF VAL(choice$) >= 1 AND VAL(choice$) <= 5 THEN PRINT choice$
  202.     LOOP UNTIL choice$ = "1" OR choice$ = "2" OR choice$ = "3" OR choice$ = "4" OR choice$ = "5"
  203.     PLAY selectionBeep$
  204.     useFile$ = "GGSave" + choice$ + ".txt"
  205.     OPEN useFile$ FOR OUTPUT AS #1
  206.     PRINT #1, STR$(Espializer7.x)
  207.     PRINT #1, STR$(Espializer7.y)
  208.     PRINT #1, STR$(shipLog.moves)
  209.     PRINT #1, STR$(shipLog.ships)
  210.     PRINT #1, STR$(shipLog.score)
  211.     PRINT #1, STR$(shipLog.morale)
  212.     PRINT #1, STR$(shipLog.currentDamage.ship)
  213.     PRINT #1, STR$(shipLog.currentDamage.medical)
  214.     PRINT #1, STR$(shipLog.totalDamage.ship)
  215.     PRINT #1, STR$(shipLog.totalDamage.medical)
  216.     PRINT #1, STR$(shipLog.currentSurvivors)
  217.     PRINT #1, STR$(shipLog.totalSurvivorsSaved)
  218.     PRINT #1, STR$(shipLog.currentMedSupply)
  219.     PRINT #1, STR$(shipLog.totalMedSupply)
  220.     PRINT #1, STR$(shipLog.enemiesDestroyed)
  221.  
  222.     'ship log done
  223.     PRINT #1, STR$(quizPassed)
  224.     PRINT #1, STR$(shipsInSarienFleet)
  225.     PRINT #1, STR$(fleetJumpsWhenThisReaches0)
  226.     PRINT #1, STR$(tabToggle)
  227.     PRINT #1, STR$(beenToMenu)
  228.     PRINT #1, STR$(gameInProgress)
  229.     ' and now the grid
  230.     FOR x = 1 TO 80
  231.         FOR y = 1 TO 45
  232.             FOR f = 1 TO 3
  233.                 PRINT #1, STR$(grid(x, y, f))
  234.             NEXT f
  235.         NEXT y
  236.     NEXT x
  237.     CLOSE #1
  238.     _DELAY (1)
  239.     a$ = "You game has been saved."
  240.     LOCATE 27, GetCenter(a$)
  241.     PRINT a$
  242.     _DELAY (1.5)
  243.     CALL MainMenu
  244.  
  245. SUB LoadSavedGame
  246.     COLOR 14, 10
  247.     CLS
  248.     DIM fileName$(1 TO 5)
  249.     FOR cnt = 1 TO 5
  250.         fileName$(cnt) = "GGSave" + LTRIM$(STR$(cnt)) + ".txt"
  251.     NEXT cnt
  252.     COLOR 12, 9
  253.     CLS
  254.     FOR cnt = 1 TO 5
  255.         LOCATE 9, 1
  256.         PRINT "  Slot     Lives     Score     Moves     Morale     Damage     Crew Injured"
  257.         LOCATE 11 + (cnt * 2), 1
  258.         COLOR 14, 9
  259.         PRINT "    " + LTRIM$(STR$(cnt))
  260.         COLOR 7, 9
  261.         IF _FILEEXISTS(fileName$(cnt)) = 0 THEN
  262.             LOCATE 11 + (cnt * 2), 20
  263.             PRINT "No information"
  264.         ELSE
  265.             OPEN fileName$(cnt) FOR INPUT AS #1
  266.             LINE INPUT #1, espX$
  267.             LINE INPUT #1, espY$
  268.             LINE INPUT #1, shipMoves$
  269.             LINE INPUT #1, shipStat$
  270.             LINE INPUT #1, scoreStat$
  271.             LINE INPUT #1, moraleStat$
  272.             LINE INPUT #1, damStat$
  273.             LINE INPUT #1, injStat$
  274.             CLOSE #1
  275.             LOCATE 11 + (cnt * 2), 13
  276.             PRINT shipStat$
  277.             LOCATE 11 + (cnt * 2), 22
  278.             PRINT scoreStat$
  279.             LOCATE 11 + (cnt * 2), 32
  280.             PRINT shipMoves$
  281.             LOCATE 11 + (cnt * 2), 42
  282.             PRINT moraleStat$
  283.             LOCATE 11 + (cnt * 2), 53
  284.             PRINT USING "##%"; VAL(damStat$)
  285.             LOCATE 11 + (cnt * 2), 65
  286.             PRINT USING "##%"; VAL(injStat$)
  287.         END IF
  288.     NEXT cnt
  289.  
  290.     a$ = "Which save slot? (ESC to cancel) "
  291.     COLOR 10, 9
  292.     LOCATE 24, GetCenter(a$)
  293.     PRINT a$;
  294.     DO
  295.         choice$ = INPUT$(1)
  296.         LOCATE 24, 57
  297.         IF VAL(choice$) >= 1 AND VAL(coice$) <= 5 THEN PRINT choice$
  298.         IF choice$ = CHR$(27) THEN
  299.             'gameInProgress = FALSE
  300.             CALL MainMenu
  301.         END IF
  302.     LOOP UNTIL choice$ = "1" OR choice$ = "2" OR choice$ = "3" OR choice$ = "4" OR choice$ = "5"
  303.     PLAY selectionBeep$
  304.     useFile$ = "GGSave" + choice$ + ".txt"
  305.     IF _FILEEXISTS(useFile$) = 0 THEN
  306.         CLS
  307.         LOCATE 20, GetCenter("File not found.")
  308.         PRINT "FILE NOT FOUND"
  309.         PLAY "MB" + errorBeep
  310.         _DELAY (2)
  311.         gameInProgress = FALSE
  312.         CALL MainMenu
  313.     END IF
  314.     OPEN useFile$ FOR INPUT AS #1
  315.     LINE INPUT #1, esplzrX$
  316.     Espializer7.x = VAL(esplzrX$)
  317.     LINE INPUT #1, espCoord$
  318.     Espializer7.y = VAL(espCoord$)
  319.     LINE INPUT #1, slMv$
  320.     shipLog.moves = VAL(slMv$)
  321.     LINE INPUT #1, slShips$
  322.     shipLog.ships = VAL(slShips$)
  323.     LINE INPUT #1, slScore$
  324.     shipLog.score = VAL(slScore$)
  325.     LINE INPUT #1, slMorale$
  326.     shipLog.morale = VAL(slMorale$)
  327.     LINE INPUT #1, slCDs$
  328.     shipLog.currentDamage.ship = VAL(slCDs$)
  329.     LINE INPUT #1, slCDm$
  330.     shipLog.currentDamage.medical = VAL(slCDm$)
  331.     LINE INPUT #1, slTDs$
  332.     shipLog.totalDamage.ship = VAL(slTDs$)
  333.     LINE INPUT #1, slTDm$
  334.     shipLog.totalDamage.medical = VAL(slTDm$)
  335.     LINE INPUT #1, slCS$
  336.     shipLog.currentSurvivors = VAL(slCS$)
  337.     LINE INPUT #1, slTS$
  338.     shipLog.totalSurvivorsSaved = VAL(slTS$)
  339.     LINE INPUT #1, slCMS$
  340.     shipLog.currentMedSupply = VAL(slCMS$)
  341.     LINE INPUT #1, slTM$
  342.     shipLog.totalMedSupply = VAL(slTM$)
  343.     LINE INPUT #1, slED$
  344.     shipLog.enemiesDestroyed = VAL(slED$)
  345.  
  346.     'ship log done
  347.     LINE INPUT #1, qp$
  348.     quizPassed = VAL(qp$)
  349.     LINE INPUT #1, sif$
  350.     shipsInSarienFleet = VAL(sif$)
  351.     LINE INPUT #1, fj$
  352.     fleetJumpsWhenThisReaches0 = VAL(fj$)
  353.     LINE INPUT #1, tt$
  354.     tabToggle = VAL(tt$)
  355.     LINE INPUT #1, btm$
  356.     beenToMenu = VAL(btm$)
  357.     LINE INPUT #1, gip$
  358.     gameInProgress = VAL(gip$)
  359.     ' and now the grid
  360.     FOR x = 1 TO 80
  361.         FOR y = 1 TO 45
  362.             FOR f = 1 TO 3
  363.                 LINE INPUT #1, char$
  364.                 grid(x, y, f) = VAL(char$)
  365.             NEXT f
  366.         NEXT y
  367.     NEXT x
  368.     CLOSE #1 'hope i didn't forget anything
  369.     _DELAY (1)
  370.     COLOR 15, 0
  371.     CLS
  372.     CALL PlayGalaxyGrid("Y")
  373.  
  374. SUB Status
  375.     'Stats
  376.     SELECT CASE tabToggle
  377.         CASE 1
  378.             GOTO gameInfo
  379.         CASE 2
  380.             GOTO mapKey
  381.         CASE 3
  382.             GOTO commandList
  383.     END SELECT
  384.  
  385.     gameInfo:
  386.  
  387.     COLOR 15, 0
  388.     LOCATE 46, 1
  389.     PRINT "Espializer 7 Coordinates (";
  390.     COLOR esplzr.clr, 0
  391.     PRINT LTRIM$(STR$(Espializer7.x));
  392.     COLOR 15, 0
  393.     PRINT ", ";
  394.     COLOR esplzr.clr, 0
  395.     PRINT LTRIM$(STR$(Espializer7.y));
  396.     COLOR 15, 0
  397.     PRINT ")"
  398.     COLOR 15, 0
  399.     LOCATE 46, 36
  400.     PRINT "Moves: ";
  401.     COLOR esplzr.clr, 0
  402.     PRINT USING "#,###"; shipLog.moves
  403.     LOCATE 46, 66
  404.     PRINT "Morale: ";
  405.     COLOR esplzr.clr
  406.     PRINT LTRIM$(STR$(shipLog.morale))
  407.     COLOR 15, 0
  408.     LOCATE 47, 1
  409.     COLOR 15, 0
  410.     PRINT "Systems Damaged: ";
  411.     COLOR 12, 0
  412.     PRINT LTRIM$(STR$(shipLog.currentDamage.ship)); "%"
  413.     COLOR 15.0
  414.     LOCATE 47, 22
  415.     PRINT "Medical Supplies: ";
  416.     COLOR otherPlanet.clr, 0
  417.     PRINT LTRIM$(STR$(shipLog.currentMedSupply))
  418.     LOCATE 47, 67
  419.     COLOR 15, 0
  420.     PRINT "Lives: ";
  421.     COLOR esplzr.clr, 0
  422.     PRINT LTRIM$(STR$(shipLog.ships))
  423.     COLOR 15, 0
  424.     LOCATE 48, 1
  425.     PRINT "   Crew Injured: ";
  426.     COLOR 12, 0
  427.     PRINT LTRIM$(STR$(shipLog.currentDamage.medical)); "%";
  428.     LOCATE 48, 22
  429.     COLOR 15, 0
  430.     PRINT "Survivors Aboard: ";
  431.     COLOR wifranColony.clr, 0
  432.     PRINT LTRIM$(STR$(shipLog.currentSurvivors))
  433.     COLOR 15, 0
  434.     LOCATE 48, 67
  435.     PRINT "Score: ";
  436.     COLOR esplzr.clr
  437.     PRINT LTRIM$(STR$(shipLog.score))
  438.     LOCATE 48, 43
  439.     COLOR 15, 0
  440.     LOCATE 48, 43
  441.     COLOR 14, 0
  442.     PRINT "[TAB]";
  443.     COLOR 15, 0
  444.     PRINT " = map key"
  445.     IF quizPassed = TRUE THEN
  446.         Num = fleetJumpsWhenThisReaches0
  447.         LOCATE 46, 50
  448.         COLOR 15, 0
  449.         PRINT "Fleet jump: ";
  450.         COLOR 10, 0
  451.         PRINT LTRIM$(STR$(Num))
  452.         COLOR 15, 0
  453.         LOCATE 47, 43
  454.         PRINT "Ships in Fleet: ";
  455.         COLOR 10, 0
  456.         PRINT LTRIM$(STR$(shipsInSarienFleet))
  457.     END IF
  458.     GOTO endStatus
  459.  
  460.     mapKey:
  461.     COLOR esplzr.clr, 0
  462.     LOCATE 46, 1
  463.     PRINT CHR$(esplzr.code); " = Espializer 7"
  464.     COLOR wifranColony.clr, 0
  465.     LOCATE 47, 1
  466.     PRINT CHR$(wifranColony.code); " = Drop Off Survivors"
  467.     COLOR otherPlanet.clr, 0
  468.     LOCATE 48, 1
  469.     PRINT CHR$(otherPlanet.code); " = Get Medical Kits"
  470.     COLOR Top.clr, 0
  471.     LOCATE 46, 26
  472.     PRINT CHR$(Top.code); " =  Space"
  473.     LOCATE 47, 26
  474.     PRINT CHR$(Bottom.code); " = Station"
  475.     COLOR informant.clr, 0
  476.     LOCATE 48, 26
  477.     PRINT CHR$(informant.code); " = Informant"
  478.     m$ = CHR$(sarienFleet.code)
  479.     COLOR sarienFleet.clr, 0
  480.     LOCATE 46, 41
  481.     PRINT m$; m$
  482.     LOCATE 47, 41
  483.     PRINT m$; m$; " = Sarien Fleet"
  484.     LOCATE 48, 42
  485.     COLOR sarienShip.clr, 0
  486.     PRINT CHR$(sarienShip.code); " = Sarien Cruiser"
  487.     LOCATE 47, 62
  488.     COLOR disabledShip.clr, 0
  489.     PRINT CHR$(disabledShip.code); " = Disabled Ship"
  490.     LOCATE 48, 62
  491.     COLOR 14, 0
  492.     PRINT "[TAB]";
  493.     COLOR 15, 0
  494.     PRINT " = Commands"
  495.     LOCATE 46, 62
  496.     COLOR wormHole.clr, 0
  497.     PRINT "LETTER = Wormhole"
  498.     GOTO endStatus
  499.  
  500.     commandList:
  501.     CALL ClearStatus
  502.     LOCATE 46, 1
  503.     COLOR 15, 0
  504.     PRINT "Use the arrow keys to move the ";
  505.     COLOR esplzr.clr, 0
  506.     PRINT "Espializer 7    ";
  507.     COLOR 14, 0
  508.     PRINT "[SPACEBAR]";
  509.     COLOR 15, 0
  510.     PRINT " = use information  "
  511.     LOCATE 47, 10
  512.     COLOR 14, 0
  513.     PRINT "M";
  514.     COLOR 15, 0
  515.     PRINT " = Main ";
  516.     COLOR 14, 0
  517.     PRINT "m";
  518.     COLOR 15, 0
  519.     PRINT "enu                         ";
  520.     COLOR 14, 0
  521.     PRINT "S";
  522.     COLOR 15, 0
  523.     PRINT " = ";
  524.     COLOR 14, 0
  525.     PRINT "s";
  526.     COLOR 15, 0
  527.     PRINT "ave the game  ";
  528.     LOCATE 48, 10
  529.     COLOR 14, 0
  530.     PRINT "[TAB]";
  531.     COLOR 15, 0
  532.     PRINT " = toggle display readout.       ";
  533.     COLOR 14, 0
  534.     PRINT "[ESC]";
  535.     COLOR 15, 0
  536.     PRINT " = end without save"
  537.  
  538.     endStatus:
  539.  
  540. SUB MultipleChoice
  541.     'dimension the wrong answers
  542.     DIM incorrectStatements$(1 TO 30)
  543.     incorrectStatements$(1) = "The Sariens are using their free time for stopping TV broadcasts.          "
  544.     incorrectStatements$(2) = "The Sariens are the good guys.                                             "
  545.     incorrectStatements$(3) = "The Sariens use modifided math to create wormholes.                        "
  546.     incorrectStatements$(4) = "The Sariens can inflict telepathic damage and defeat you from afar.        "
  547.     incorrectStatements$(5) = "It is possible for the Sariens to jump when you hit [J].                   "
  548.     incorrectStatements$(6) = "Wifran colonies (blue) are where to start buliding your army of soldiers.  "
  549.     incorrectStatements$(7) = "It is impossible to defeat the Sarien Fleet. Win the game by other means.  "
  550.     incorrectStatements$(8) = "It is possible for the Sariens to rearrange time to move thier Fleet.      "
  551.     incorrectStatements$(9) = "The Sarien fleet can suck you into the wake created by jumping.            "
  552.     incorrectStatements$(10) = "There are cheat keys which will help you out if you chose to use them.    "
  553.     incorrectStatements$(11) = "Push [SPACEBAR] to leave the battle with the Fleet.                       "
  554.     incorrectStatements$(12) = "You can use the arrow keys or WASD to move across the Galaxy Grid.        "
  555.     incorrectStatements$(13) = "The Sariens have a total of 35 ships on the grid.                          "
  556.     incorrectStatements$(14) = "The Quasi-Molecular Jumping Device lets Sariens travel through time.       "
  557.     incorrectStatements$(15) = "The Sariens can only use their Jumping Device when you're nearby.          "
  558.     incorrectStatements$(16) = "The QMJD is a Questionable Morally Judged Decision.                        "
  559.     incorrectStatements$(17) = "The QMJD is a Quasi-Molecular Jewel-crafting Device.                       "
  560.     incorrectStatements$(18) = "The QMJD is a tool the Sariens are using to destroy the known universe.    "
  561.     incorrectStatements$(19) = "The Quasi-Molecular Jumping Device does not really do anything.            "
  562.     incorrectStatements$(20) = "The Sariens stole the graphics in this game from Space Quest I by Sierra.  "
  563.     incorrectStatements$(21) = "Mork and Mindy is the Sariens' favorite TV program.                        "
  564.     incorrectStatements$(22) = "The QMJD used by the Sariens is an upgrade of the Star Generator.          "
  565.     incorrectStatements$(23) = "This is the correct answer.                                                "
  566.     incorrectStatements$(24) = "The Sarien fleet has infinite battleships. You can never defeat them.      "
  567.     incorrectStatements$(25) = "2 + 2 = 4. That's true so this must be the correct answer.                 "
  568.     incorrectStatements$(26) = "Watch out for black holes.                                                 "
  569.     incorrectStatements$(27) = "The Sariens look like squids with fingers.                                 "
  570.     incorrectStatements$(28) = "The QMJD changes time so that it goes sideways instead of forward or back. "
  571.     incorrectStatements$(29) = "This is not the correct choice.                                            "
  572.     incorrectStatements$(30) = "No good deeds go unpunished so you might as well join the Sariens.         "
  573.  
  574.     ' dimension correct statements
  575.     DIM correctStatements$(1 TO 10)
  576.     correctStatements$(1) = "Repaing your ship and healing you crew at the same time is less effective.  "
  577.     correctStatements$(2) = "The QMJD is a Quasi-Molecular Jumping device.                               "
  578.     correctStatements$(3) = "The QMJD allows the Sarien fleet to jump over large parts of space.         "
  579.     correctStatements$(4) = "Don't attempt to drop off survivors unless you have some aboard.            "
  580.     correctStatements$(5) = "The Sariens stole the Star Generator from Space Quest I in the 80s.         "
  581.     correctStatements$(6) = "The QMJD creates a temporary wormhole allowing the Sarien fleet to move.    "
  582.     correctStatements$(7) = "By completing this quiz, a new statistic will appear in the status area.    "
  583.     correctStatements$(8) = "Defeating the Sarien Fleet completes the game. Defeat lone ships for points."
  584.     correctStatements$(9) = "The more Sarien ships you destroy, the easier it is to destroy the next one."
  585.     correctStatements$(10) = "The Quasi-Molecular Jumping Device creates artificial wormholes.            "
  586.  
  587.     ' start the quiz with instructions and 0 correct
  588.     quizPassed = FALSE
  589.     numberCorrectlyAnswered = 0
  590.     COLOR 11, 5
  591.     CLS
  592.     a$ = "In each set of four statements you must"
  593.     b$ = "select the one mentioned by the informants."
  594.     COLOR 15, 5
  595.     LOCATE 18, GetCenter(a$)
  596.     PRINT a$
  597.     LOCATE 19, GetCenter(b$)
  598.     PRINT "select the one ";
  599.     COLOR 14, 5
  600.     PRINT "mentioned by the informants";
  601.     COLOR 15, 5
  602.     PRINT "."
  603.     LOCATE 26, 1
  604.  
  605.     ' dimnension slots for the wrong and right answers and randomly fill them
  606.     DIM answerSlots$(1 TO 4)
  607.     FOR entireQuiz = 1 TO 10
  608.         COLOR 11, 5
  609.         CLS
  610.         a$ = "In each set of four statements you must"
  611.         b$ = "select the one mentioned by the informants."
  612.         COLOR 15, 5
  613.         LOCATE 18, GetCenter(a$)
  614.         PRINT a$
  615.         LOCATE 19, GetCenter(b$)
  616.         PRINT "select the one ";
  617.         COLOR 14, 5
  618.         PRINT "mentioned by the informants";
  619.         COLOR 15, 5
  620.         PRINT "."
  621.         LOCATE 22, GetCenter("question x of 10")
  622.         COLOR 14, 5
  623.         PRINT USING "Question ## of 10"; entireQuiz
  624.         LOCATE 26, 1
  625.  
  626.         ' put the correct answer in a random slot
  627.         fillThisSlot = INT(RND * 4) + 1
  628.         differentCorrectAnswer:
  629.         rightAnswer = INT(RND * 10) + 1
  630.         IF correctStatements$(rightAnswer) = "" THEN GOTO differentCorrectAnswer
  631.         answerSlots$(fillThisSlot) = correctStatements$(rightAnswer)
  632.         correctStatements$(rightAnswer) = ""
  633.  
  634.         'put the wrong answer in the other slots
  635.         FOR filling = 1 TO 4
  636.             IF answerSlots$(filling) <> "" THEN
  637.             ELSE
  638.                 differentWrongAnswer:
  639.                 wrongAnswer = INT(RND * 30) + 1
  640.                 IF incorrectStatements$(wrongAnswer) = "" THEN GOTO differentWrongAnswer
  641.                 answerSlots$(filling) = incorrectStatements$(wrongAnswer)
  642.                 incorrectStatements$(wrongAnswer) = ""
  643.             END IF
  644.         NEXT filling
  645.  
  646.         ' display statements
  647.         COLOR 11, 5
  648.         FOR lettersToPick = 65 TO 68
  649.             COLOR 14, 5
  650.             PRINT CHR$(lettersToPick);
  651.             COLOR 11, 5
  652.             PRINT ") ";
  653.             PRINT answerSlots$(lettersToPick - 64)
  654.         NEXT lettersToPick
  655.         PRINT
  656.         LOCATE , GetCenter("Pick A, B, C or D: ")
  657.         PRINT "Pick A, B, C or D: ";
  658.         DO
  659.             pause$ = UCASE$(INPUT$(1))
  660.         LOOP UNTIL pause$ = "A" OR pause$ = "B" OR pause$ = "C" OR pause$ = "D"
  661.         PRINT pause$;
  662.         chosenAnswer = ASC(UCASE$(pause$)) - 64
  663.         IF chosenAnswer = fillThisSlot THEN
  664.             COLOR 10, 5
  665.             PRINT "   Correct"
  666.             numberCorrectlyAnswered = numberCorrectlyAnswered + 1
  667.             PLAY correctBeep$
  668.             _DELAY (hailDelay)
  669.         ELSE
  670.             PLAY errorBeep$
  671.             _DELAY (hailDelay)
  672.             GOTO gotoHere
  673.         END IF
  674.         FOR clearThem = 1 TO 4
  675.             answerSlots$(clearThem) = ""
  676.         NEXT clearThem
  677.     NEXT entireQuiz
  678.  
  679.     gotoHere:
  680.     IF numberCorrectlyAnswered = 10 THEN
  681.         quizPassed = TRUE
  682.         shipLog.morale = shipLog.morale + 200
  683.         shipLog.totalMorale = shipLog.totalMorale + 200
  684.     END IF
  685.     COLOR 15, 0
  686.     CLS
  687.     CALL PrintGrid
  688.  
  689.  
  690. SUB DockForInfo
  691.     information$(1) = "When visiting a space station your medical supplies are more efficient if you concentrate on healing your crew."
  692.     information$(2) = "Use the lettered wormholes to get to the Sairen Fleet more quickly."
  693.     information$(3) = "Press the [TAB] key to view the map key and available commands."
  694.     information$(4) = "Don't try to drop off survivors rescued from disabled ship unless you have survivors aboard."
  695.     information$(5) = "The game is won when you defeat the Sarien fleet."
  696.     information$(6) = "The way to defeat the fleet of Sarien battleships is to retreat after defeating some of them. You can retreat by escaping."
  697.     information$(7) = "It is easier to defeat the next Sarien ship each time you defeat one."
  698.     information$(8) = "Pressing [SPACEBAR] will give you a quiz about the information us informants give you. Scoring 100% correct will let you know when the Sarien Feelt is planning to activate their Quasi-Molecular Jumping Device."
  699.     information$(9) = "The Quasi-Molecular Jumping Device (QMJD) changes atomic structures to create a temporary artificial wormhole to effect travel. This allows the Sarien Fleet to jump over large and small points on the grid."
  700.     information$(10) = "The Sariens are known throughout the galaxy as the ones who stole the Star Generator way back in Space Quest 1: The Sarien Encounter, a hit video game from the 1980s."
  701.  
  702.     shipLog.score = shipLog.score + 25
  703.     shipLog.morale = shipLog.morale + 1
  704.     CLS
  705.     'Draw the
  706.     COLOR 7
  707.     FOR lp = 1 TO 9
  708.         CALL HorizontalLine(1, 80, lp, t$)
  709.     NEXT lp
  710.     CALL HorizontalLine(1, 4, 10, t$)
  711.     CALL HorizontalLine(1, 3, 11, t$)
  712.     CALL HorizontalLine(1, 2, 12, t$)
  713.     CALL Plot(1, 13, t$)
  714.     CALL HorizontalLine(20, 42, 10, t$)
  715.     CALL HorizontalLine(21, 41, 11, t$)
  716.     CALL HorizontalLine(22, 40, 12, t$)
  717.     CALL HorizontalLine(23, 39, 13, t$)
  718.     CALL HorizontalLine(24, 38, 14, t$)
  719.     CALL HorizontalLine(25, 37, 15, t$)
  720.     CALL HorizontalLine(58, 80, 10, t$)
  721.     CALL HorizontalLine(59, 80, 11, t$)
  722.     CALL HorizontalLine(60, 80, 12, t$)
  723.     CALL HorizontalLine(61, 80, 13, t$)
  724.     CALL HorizontalLine(62, 80, 14, t$)
  725.     CALL HorizontalLine(63, 80, 15, t$)
  726.     COLOR 8
  727.     CALL HorizontalLine(10, 11, 10, t$)
  728.     CALL HorizontalLine(13, 14, 10, t$)
  729.     CALL HorizontalLine(48, 49, 10, t$)
  730.     CALL HorizontalLine(51, 52, 10, t$)
  731.     CALL DrawEspializer7("W", 75, 41, 0)
  732.     ClearStatus
  733.     COLOR 15, 0
  734.     a$ = "You arrive at a Space Station of special interest to those who trade in information. The Wifran war with the Sariens hampers their abilities to sell information. With your promise to destory the evil Sariens, the information trader at this  has agreed to give you some precious intel."
  735.     LOCATE 25
  736.     PRINT LongCenter(a$)
  737.     COLOR 10, 0
  738.     a$ = "push [SPACEBAR] to dock with the ."
  739.     LOCATE 34, GetCenter(a$)
  740.     PRINT "Push ";
  741.     COLOR 14, 0
  742.     PRINT "[SPACEBAR]";
  743.     COLOR 10, 0
  744.     PRINT " to dock with the ."
  745.     CALL WaitForCharacter(" ")
  746.     FOR y = 25 TO 34
  747.         LOCATE y, 1
  748.         PRINT STRING$(70, " ")
  749.     NEXT y
  750.     'Move the Espializer7
  751.     FOR x = 75 TO 50 STEP -1
  752.         CALL DrawEspializer7("W", x, 41, 0)
  753.         _DELAY (movingShipDelay)
  754.         IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  755.         CALL DrawEspializer7("W", x, 41, 1)
  756.     NEXT x
  757.     FOR y = 42 TO 27 STEP -1
  758.         CALL DrawEspializer7("N", 50, y, 0)
  759.         _DELAY (movingShipDelay)
  760.         IF y MOD movingShipMod = 0 THEN PLAY movingShipBeep
  761.         IF y <> 27 THEN
  762.             CALL DrawEspializer7("N", 50, y, 1)
  763.         END IF
  764.     NEXT y
  765.     'open the docking bay
  766.     COLOR 8
  767.     CALL HorizontalLine(48, 49, 11, t$)
  768.     CALL HorizontalLine(51, 52, 11, t$)
  769.     _DELAY (dockingDelay)
  770.     PLAY dockingBeep
  771.     CALL HorizontalLine(48, 49, 12, t$)
  772.     CALL HorizontalLine(51, 52, 12, t$)
  773.     _DELAY (dockingDelay)
  774.     PLAY dockingBeep
  775.     CALL Plot(48, 13, t$)
  776.     CALL Plot(52, 13, t$)
  777.     _DELAY (dockingDelay)
  778.     PLAY dockingBeep
  779.     CALL Plot(48, 14, t$)
  780.     CALL Plot(52, 14, t$)
  781.     _DELAY (dockingDelay)
  782.     PLAY dockingBeep
  783.     CALL Plot(48, 15, t$)
  784.     CALL Plot(52, 15, t$)
  785.     _DELAY (dockingDelay)
  786.     PLAY dockingBeep
  787.     CALL HorizontalLine(47, 48, 16, t$)
  788.     CALL HorizontalLine(52, 53, 16, t$)
  789.  
  790.     'dock
  791.     FOR y = 27 TO 19 STEP -1
  792.         CALL DrawEspializer7("N", 50, y, 0)
  793.         _DELAY (dockingDelay)
  794.         IF y = 23 OR y = 19 OR y = 16 THEN PLAY movingShipBeep
  795.         IF y <> 19 THEN
  796.             CALL DrawEspializer7("N", 50, y, 1)
  797.         END IF
  798.     NEXT y
  799.  
  800.     theString$ = LongCenter$(information$(grid(Espializer7.x, Espializer7.y, 3)))
  801.     LOCATE 2, 1
  802.     COLOR informant.clr, 7
  803.     FOR x = 1 TO LEN(theString$)
  804.         theLetter$ = MID$(theString$, x, 1)
  805.         PRINT theLetter$;
  806.         IF theLetter$ <> " " THEN
  807.             IF x MOD 2 = 0 THEN PLAY printingBeep$
  808.             _DELAY (printingDelay)
  809.         END IF
  810.     NEXT x
  811.     LOCATE 48, GetCenter("Push 'r' to return to the grid.")
  812.     COLOR 10, 0
  813.     PRINT "Push " + CHR$(34);
  814.     COLOR 14, 0
  815.     PRINT "R";
  816.     COLOR 10, 0
  817.     PRINT CHR$(34) + " to ";
  818.     COLOR 14, 0
  819.     PRINT "r";
  820.     COLOR 10, 0
  821.     PRINT "eturn to the Galaxy Grid."
  822.     CALL WaitForCharacter("r")
  823.     PLAY returnBeep
  824.     COLOR 15, 0
  825.     CLS
  826.     'erase the informant from the Grid
  827.     grid(Espializer7.x, Espializer7.y, 3) = 0
  828.     CALL PrintGrid
  829.  
  830. FUNCTION LongCenter$ (text$)
  831.     DO
  832.         cutHere = 46
  833.         DO
  834.             cutHere = cutHere - 1
  835.             cutting$ = MID$(text$, cutHere, 1)
  836.         LOOP UNTIL cutting$ = " "
  837.         partString$ = MID$(text$, 1, cutHere)
  838.         text$ = MID$(text$, cutHere + 1, LEN(text$))
  839.         spaces$ = STRING$(GetCenter(partString$), " ")
  840.         cutString$ = spaces$ + partString$ + spaces$
  841.         returnThis$ = returnThis$ + cutString$
  842.     LOOP UNTIL LEN(text$) < 30
  843.     numLastSpaces = GetCenter(text$)
  844.     lastSpaces$ = STRING$(numLastSpaces, " ")
  845.     returnThis$ = returnThis$ + lastSpaces$ + text$ + lastSpaces$
  846.     LongCenter$ = returnThis$
  847.  
  848. SUB SpaceStation
  849.     ' maybe do a repair sound and a delay
  850.     COLOR 0, 0
  851.     CLS
  852.  
  853.     'Draw the
  854.     COLOR 7
  855.     FOR lp = 1 TO 9
  856.         CALL HorizontalLine(1, 80, lp, t$)
  857.     NEXT lp
  858.     CALL HorizontalLine(1, 4, 10, t$)
  859.     CALL HorizontalLine(1, 3, 11, t$)
  860.     CALL HorizontalLine(1, 2, 12, t$)
  861.     CALL Plot(1, 13, t$)
  862.     CALL HorizontalLine(20, 42, 10, t$)
  863.     CALL HorizontalLine(21, 41, 11, t$)
  864.     CALL HorizontalLine(22, 40, 12, t$)
  865.     CALL HorizontalLine(23, 39, 13, t$)
  866.     CALL HorizontalLine(24, 38, 14, t$)
  867.     CALL HorizontalLine(25, 37, 15, t$)
  868.     CALL HorizontalLine(58, 80, 10, t$)
  869.     CALL HorizontalLine(59, 80, 11, t$)
  870.     CALL HorizontalLine(60, 80, 12, t$)
  871.     CALL HorizontalLine(61, 80, 13, t$)
  872.     CALL HorizontalLine(62, 80, 14, t$)
  873.     CALL HorizontalLine(63, 80, 15, t$)
  874.     COLOR 8
  875.     CALL HorizontalLine(10, 11, 10, t$)
  876.     CALL HorizontalLine(13, 14, 10, t$)
  877.     CALL HorizontalLine(48, 49, 10, t$)
  878.     CALL HorizontalLine(51, 52, 10, t$)
  879.  
  880.     CALL DrawEspializer7("W", 75, 41, 0)
  881.     ClearStatus
  882.     COLOR 10, 0
  883.     a$ = "push [SPACEBAR] to dock with the ."
  884.     LOCATE 25, GetCenter(a$)
  885.     PRINT "Push ";
  886.     COLOR 14, 0
  887.     PRINT "[SPACEBAR]";
  888.     COLOR 10, 0
  889.     PRINT " to dock with the ."
  890.     CALL WaitForCharacter(" ")
  891.     LOCATE 25, GetCenter(a$)
  892.     PRINT STRING$(LEN(a$), " ")
  893.     'Move the Espializer7
  894.     FOR x = 75 TO 16 STEP -1
  895.         CALL DrawEspializer7("W", x, 41, 0)
  896.         _DELAY (movingShipDelay)
  897.         IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  898.         CALL DrawEspializer7("W", x, 41, 1)
  899.     NEXT x
  900.     FOR y = 42 TO 27 STEP -1
  901.         CALL DrawEspializer7("N", 12, y, 0)
  902.         _DELAY (movingShipDelay)
  903.         IF y MOD movingShipMod = 0 THEN PLAY movingShipBeep
  904.         IF y <> 27 THEN
  905.             CALL DrawEspializer7("N", 12, y, 1)
  906.         END IF
  907.     NEXT y
  908.     'open the docking bay
  909.     COLOR 8
  910.     CALL HorizontalLine(10, 11, 11, t$)
  911.     CALL HorizontalLine(13, 14, 11, t$)
  912.     _DELAY (dockingDelay)
  913.     PLAY dockingBeep
  914.     CALL HorizontalLine(10, 11, 12, t$)
  915.     CALL HorizontalLine(13, 14, 12, t$)
  916.     _DELAY (dockingDelay)
  917.     PLAY dockingBeep
  918.     CALL Plot(10, 13, t$)
  919.     CALL Plot(14, 13, t$)
  920.     _DELAY (dockingDelay)
  921.     PLAY dockingBeep
  922.     CALL Plot(10, 14, t$)
  923.     CALL Plot(14, 14, t$)
  924.     _DELAY (dockingDelay)
  925.     PLAY dockingBeep
  926.     CALL Plot(10, 15, t$)
  927.     CALL Plot(14, 15, t$)
  928.     _DELAY (dockingDelay)
  929.     PLAY dockingBeep
  930.     CALL HorizontalLine(9, 10, 16, t$)
  931.     CALL HorizontalLine(14, 15, 16, t$)
  932.  
  933.     'dock
  934.     FOR y = 27 TO 19 STEP -1
  935.         CALL DrawEspializer7("N", 12, y, 0)
  936.         _DELAY (dockingDelay)
  937.         IF y = 23 OR y = 19 OR y = 16 THEN PLAY movingShipBeep
  938.         IF y <> 19 THEN
  939.             CALL DrawEspializer7("N", 12, y, 1)
  940.         END IF
  941.     NEXT y
  942.  
  943.     c = shipLog.currentDamage.ship '        if damage is 100, 100% of the ship is damaged and therefore destroyed. same for med
  944.     td = shipLog.totalDamage.ship
  945.     m = shipLog.currentDamage.medical
  946.     mt = shipLog.totalDamage.medical
  947.     s = shipLog.currentMedSupply
  948.     ml = shipLog.morale
  949.  
  950.     ClearStatus
  951.     COLOR 13, 7 'Purple on the  bg
  952.     LOCATE 5, 17
  953.     IF ml > 0 AND c > 0 THEN
  954.         COLOR 14, 7
  955.         PRINT "1";
  956.         COLOR 5, 7
  957.         PRINT ". Repair the ship"
  958.     ELSE
  959.         COLOR 0, 7
  960.         PRINT "1. Repair the ship"
  961.     END IF
  962.     LOCATE 6, 17
  963.     IF s > 0 AND m > 0 THEN
  964.         COLOR 14, 7
  965.         PRINT "2";
  966.         COLOR 5, 7
  967.         PRINT ". Heal the crew"
  968.     ELSE
  969.         COLOR 0, 7
  970.         PRINT "2. Heal the crew"
  971.     END IF
  972.     LOCATE 6, 42
  973.     IF s > 0 AND ml > 0 AND c > 0 AND m > 0 THEN
  974.         COLOR 14, 7
  975.         PRINT "3";
  976.         COLOR 5, 7
  977.         PRINT ". Heal and repair"
  978.     ELSE
  979.         COLOR 0, 7
  980.         PRINT "3. Heal and repair"
  981.     END IF
  982.     LOCATE 7, 42
  983.     COLOR 14, 7
  984.     PRINT "4";
  985.     COLOR 5, 7
  986.     PRINT ". Exit"
  987.     COLOR esplzr.clr, 0
  988.     LOCATE 18, 32
  989.     PRINT USING "##%"; c;
  990.     COLOR 15, 0
  991.     PRINT " of the ";
  992.     COLOR esplzr.clr, 0
  993.     PRINT "Espializer 7";
  994.     COLOR 15, 0
  995.     PRINT " is ";
  996.     COLOR esplzr.clr, 0
  997.     PRINT "damaged.  "
  998.     LOCATE 19, 32
  999.     COLOR otherPlanet.clr, 0
  1000.     PRINT USING "##%"; m;
  1001.     COLOR 15, 0
  1002.     PRINT " of the ";
  1003.     COLOR otherPlanet.clr, 0
  1004.     PRINT "crew";
  1005.     COLOR 15, 0
  1006.     PRINT " has been ";
  1007.     COLOR otherPlanet.clr, 0
  1008.     PRINT "injured.  "
  1009.     LOCATE 22, 31
  1010.     COLOR otherPlanet.clr, 0
  1011.     IF s = 1 THEN
  1012.         PRINT USING "# medical solution kit"; s;
  1013.         COLOR 15, 0
  1014.         PRINT " is available for use.   "
  1015.     ELSEIF s > 1 AND s < 10 OR (s = 0) THEN
  1016.         PRINT USING "# medical solution kits"; s;
  1017.         COLOR 15, 0
  1018.         PRINT " are available for use.   "
  1019.     ELSEIF s > 9 THEN
  1020.         PRINT USING "## medical solution kits"; s;
  1021.         COLOR 15, 0
  1022.         PRINT " are available for use. "
  1023.     END IF
  1024.     LOCATE 34, 40
  1025.     COLOR 15, 0
  1026.     IF ml = 1 THEN
  1027.         PRINT "You have ";
  1028.         COLOR 6, 0
  1029.         PRINT USING "# morale point"; ml;
  1030.         COLOR 15, 0
  1031.         PRINT " to use.   "
  1032.     ELSEIF ml > 1 AND ml < 10 OR (ml = 0) THEN '                2 to 9
  1033.         PRINT "You have ";
  1034.         COLOR 6, 0
  1035.         PRINT USING "# morale points"; ml;
  1036.         COLOR 15, 0
  1037.         PRINT " to use.   "
  1038.     ELSEIF ml > 9 AND ml < 100 THEN '                           10 to 99
  1039.         PRINT "You have ";
  1040.         COLOR 6, 0
  1041.         PRINT USING "## morale points"; ml;
  1042.         COLOR 15, 0
  1043.         PRINT " to use.   "
  1044.     ELSEIF ml > 99 AND ml < 1000 THEN '                         100 to 999
  1045.         PRINT "You have ";
  1046.         COLOR 6, 0
  1047.         PRINT USING "### morale points"; ml;
  1048.         COLOR 15, 0
  1049.         PRINT " to use.   "
  1050.     ELSEIF ml > 1000 AND ml < 10000 THEN
  1051.         PRINT "You have ";
  1052.         COLOR 6, 0
  1053.         PRINT USING "#,### morale points"; ml;
  1054.         COLOR 15, 0
  1055.         PRINT " to use.   "
  1056.     ELSE
  1057.         PRINT "You have ";
  1058.         COLOR 6, 0
  1059.         PRINT USING "##,### morale points"; ml;
  1060.         COLOR 15, 0
  1061.         PRINT " to use.   "
  1062.     END IF
  1063.     COLOR 6, 0
  1064.     LOCATE 38, 40
  1065.     PRINT LTRIM$(STR$(c * 5)) + " morale points";
  1066.     COLOR 15, 0
  1067.     PRINT " are required to"
  1068.     LOCATE 39, 45
  1069.     PRINT "completely repair the ship."
  1070.  
  1071.     LOCATE 29, 10
  1072.     COLOR 14, 0
  1073.     PRINT "Command number:"
  1074.     DO
  1075.         cfg$ = INKEY$
  1076.         cmd = VAL(cfg$)
  1077.     LOOP UNTIL (cmd = 1 AND ml > 0 AND c > 0) OR (cmd = 2 AND s > 0 AND m > 0) OR (cmd = 3 AND ml > 0 AND s > 0 AND c > 0 AND m > 0) OR cmd = 4
  1078.     IF cmd = 1 THEN
  1079.         PLAY shipRepairBeep
  1080.     ELSEIF cmd = 2 THEN PLAY medicalRepairBeep
  1081.     ELSEIF cmd = 3 THEN PLAY shipRepairBeep + "P10" + medicalRepairBeep
  1082.     END IF
  1083.     COLOR 13, 7
  1084.     'gray them out after choosing
  1085.     LOCATE 5, 17
  1086.     COLOR 0, 7
  1087.     PRINT "1. Repair the ship"
  1088.     LOCATE 6, 17
  1089.     COLOR 0, 7
  1090.     PRINT "2. Heal the crew"
  1091.     LOCATE 6, 42
  1092.     COLOR 0, 7
  1093.     PRINT "3. Heal and repair"
  1094.     LOCATE 7, 42
  1095.     COLOR 0, 7
  1096.     PRINT "4. Exit"
  1097.     LOCATE 29, 26
  1098.     COLOR 14, 0
  1099.     PRINT cfg$
  1100.     PLAY selectionBeep$
  1101.     LOCATE 20, 32
  1102.     PRINT STRING$(80 - 32, CHR$(32))
  1103.  
  1104.     SELECT CASE cmd
  1105.         CASE 1
  1106.             td = td + c
  1107.             DO
  1108.                 IF ml >= 5 AND c > 0 THEN
  1109.                     c = c - 1
  1110.                     ml = ml - 5
  1111.                 END IF
  1112.             LOOP UNTIL c = 0 OR ml < 5
  1113.             IF c <> 0 THEN td = td - c
  1114.             shipLog.score = shipLog.score + 1
  1115.         CASE 2
  1116.             mt = mt + m
  1117.             DO UNTIL s = 0 OR m = 0
  1118.                 heal = INT(RND * 20) + 1
  1119.                 IF m >= heal THEN
  1120.                     m = m - heal
  1121.                 ELSE
  1122.                     m = 0
  1123.                 END IF
  1124.                 s = s - 1
  1125.             LOOP
  1126.             IF m > 0 THEN mt = mt - m
  1127.             shipLog.score = shipLog.score + 1
  1128.         CASE 3
  1129.             mt = mt + m
  1130.             DO UNTIL s = 0 OR m = 0
  1131.                 heal = INT(RND * 10) + 1
  1132.                 IF m >= heal THEN
  1133.                     m = m - heal
  1134.                 ELSE
  1135.                     m = 0
  1136.                 END IF
  1137.                 s = s - 1
  1138.             LOOP
  1139.             IF m > 0 THEN mt = mt - m
  1140.             td = td + c
  1141.             DO UNTIL c = 0 OR ml < 5
  1142.                 c = c - 1
  1143.                 ml = ml - 5
  1144.             LOOP
  1145.             IF c > 0 THEN td = td - c
  1146.             shipLog.score = shipLog.score + 1
  1147.     END SELECT
  1148.     IF cmd <> 4 THEN
  1149.         _DELAY (hailDelay * 2)
  1150.     END IF
  1151.  
  1152.     COLOR esplzr.clr, 0
  1153.     LOCATE 18, 32
  1154.     PRINT USING "##%"; c;
  1155.     COLOR 15, 0
  1156.     PRINT " of the ";
  1157.     COLOR esplzr.clr, 0
  1158.     PRINT "Espializer 7";
  1159.     COLOR 15, 0
  1160.     PRINT " is ";
  1161.     COLOR esplzr.clr, 0
  1162.     PRINT "damaged.  "
  1163.     LOCATE 19, 32
  1164.     COLOR otherPlanet.clr, 0
  1165.     PRINT USING "##%"; m;
  1166.     COLOR 15, 0
  1167.     PRINT " of the ";
  1168.     COLOR otherPlanet.clr, 0
  1169.     PRINT "crew";
  1170.     COLOR 15, 0
  1171.     PRINT " has been ";
  1172.     COLOR otherPlanet.clr, 0
  1173.     PRINT "injured.  "
  1174.     LOCATE 22, 31
  1175.     COLOR otherPlanet.clr, 0
  1176.     IF s = 1 THEN
  1177.         PRINT USING "# medical solution kit"; s;
  1178.         COLOR 15, 0
  1179.         PRINT " is available for use.   "
  1180.     ELSEIF s > 1 AND s < 10 OR s = 0 THEN
  1181.         PRINT USING "# medical solution kits"; s;
  1182.         COLOR 15, 0
  1183.         PRINT " are available for use.   "
  1184.     ELSEIF s > 9 THEN
  1185.         PRINT USING "## medical solution kits"; s;
  1186.         COLOR 15, 0
  1187.         PRINT " are available for use.   "
  1188.     END IF
  1189.     LOCATE 34, 40
  1190.     COLOR 15, 0
  1191.     IF ml = 1 THEN
  1192.         PRINT "You have ";
  1193.         COLOR 6, 0
  1194.         PRINT USING "# morale point"; ml;
  1195.         COLOR 15, 0
  1196.         PRINT " to use.   " 'morale is subtracted by 5s but I may have need of this later as the coding continues -- someone once said "it's all in the details" -- every time I see a plural after a 1 I feel irritated
  1197.     ELSEIF ml > 1 AND ml < 10 OR (ml = 0) THEN '                2 to 9
  1198.         PRINT "You have ";
  1199.         COLOR 6, 0
  1200.         PRINT USING "# morale points"; ml;
  1201.         COLOR 15, 0
  1202.         PRINT " to use.   "
  1203.     ELSEIF ml > 9 AND ml < 100 THEN '                           10 to 99
  1204.         PRINT "You have ";
  1205.         COLOR 6, 0
  1206.         PRINT USING "## morale points"; ml;
  1207.         COLOR 15, 0
  1208.         PRINT " to use.   "
  1209.     ELSEIF ml > 99 AND ml < 1000 THEN '                         100 to 999
  1210.         PRINT "You have ";
  1211.         COLOR 6, 0
  1212.         PRINT USING "### morale points"; ml;
  1213.         COLOR 15, 0
  1214.         PRINT " to use.   "
  1215.     ELSEIF ml > 1000 AND ml < 10000 THEN
  1216.         PRINT "You have ";
  1217.         COLOR 6, 0
  1218.         PRINT USING "#,### morale points"; ml;
  1219.         COLOR 15, 0
  1220.         PRINT " to use.   "
  1221.     ELSE
  1222.         PRINT "You have ";
  1223.         COLOR 6, 0
  1224.         PRINT USING "##,### morale points"; ml;
  1225.         COLOR 15, 0
  1226.         PRINT " to use.   " ' dunno if this is necessary at all
  1227.     END IF
  1228.     COLOR 6, 0
  1229.     LOCATE 38, 40
  1230.     PRINT LTRIM$(STR$(c * 5)) + " morale points";
  1231.     COLOR 15, 0
  1232.     PRINT " are required to"
  1233.     LOCATE 39, 45
  1234.     PRINT "completely repair the ship."
  1235.  
  1236.     COLOR 10, 0
  1237.     LOCATE 43, GetCenter("Push r to return to the Galaxy Grid.")
  1238.     PRINT "Push " + CHR$(34);
  1239.     COLOR 14, 0
  1240.     PRINT "R";
  1241.     COLOR 10, 0
  1242.     PRINT CHR$(34) + " to ";
  1243.     COLOR 14, 0
  1244.     PRINT "r";
  1245.     COLOR 10, 0
  1246.     PRINT "eturn to the Galaxy Grid."
  1247.     CALL WaitForCharacter("r")
  1248.     PLAY returnBeep
  1249.     shipLog.currentDamage.ship = c
  1250.     shipLog.totalDamage.ship = td
  1251.     shipLog.currentDamage.medical = m
  1252.     shipLog.totalDamage.medical = mt
  1253.     shipLog.currentMedSupply = s
  1254.     shipLog.morale = ml
  1255.     CLS
  1256.     CALL PrintGrid
  1257.  
  1258. SUB AidDisabledShip
  1259.     COLOR 0, 0
  1260.     CLS
  1261.     COLOR 15, 0
  1262.     LOCATE 12, 15
  1263.     PRINT "The Espializer 7 approaches"
  1264.     LOCATE 13, 17
  1265.     PRINT "a disabled Wifran ship.    ";
  1266.     LOCATE 16, 20
  1267.     COLOR 10, 0
  1268.     PRINT "Push ";
  1269.     COLOR 14, 0
  1270.     PRINT "[SPACEBAR]";
  1271.     COLOR 10, 0
  1272.     PRINT "."
  1273.  
  1274.     ' draw the disabled ship
  1275.     COLOR 7, 0
  1276.     CALL Plot(5, 12, CHR$(219))
  1277.     CALL HorizontalLine(4, 6, 13, CHR$(219))
  1278.     CALL HorizontalLine(3, 7, 14, CHR$(219))
  1279.     CALL HorizontalLine(4, 6, 15, CHR$(219))
  1280.     CALL Plot(5, 16, CHR$(219))
  1281.     COLOR 9, 0
  1282.     CALL VerticalLine(9, 13, 3, CHR$(219))
  1283.     CALL VerticalLine(9, 13, 7, CHR$(219))
  1284.     COLOR 12, 15
  1285.     CALL Plot(5, 14, "*")
  1286.  
  1287.     CALL DrawEspializer7("W", 76, 37, 0)
  1288.     CALL WaitForCharacter(" ")
  1289.     ClearStatus
  1290.     'move the Espializer7 to the left
  1291.     FOR x = 76 TO 50 STEP -1
  1292.         CALL DrawEspializer7("W", x, 37, 0)
  1293.         _DELAY (movingShipDelay)
  1294.         IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  1295.         CALL DrawEspializer7("W", x, 37, 1)
  1296.     NEXT x
  1297.     ' move the Espializer 7 up
  1298.     FOR y = 41 TO 19 STEP -1
  1299.         CALL DrawEspializer7("N", 46, y, 0)
  1300.         _DELAY (movingShipDelay)
  1301.         IF y MOD movingShipMod = 0 THEN PLAY movingShipBeep
  1302.         CALL DrawEspializer7("N", 46, y, 1)
  1303.     NEXT y
  1304.     'move the espializer left again and run over the text
  1305.     FOR x = 50 TO 15 STEP -1
  1306.         CALL DrawEspializer7("W", x, 15, 0)
  1307.         _DELAY (movingShipDelay)
  1308.         IF x >= 21 AND x <= 47 THEN
  1309.             IF x MOD 3 = 0 THEN PLAY runOverText$
  1310.         ELSE
  1311.             IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  1312.         END IF
  1313.         IF x = 15 THEN GOTO skipBlack
  1314.         CALL DrawEspializer7("W", x, 15, 1)
  1315.         skipBlack:
  1316.     NEXT x
  1317.     GOTO skipOver
  1318.  
  1319.     showNumOnBoard:
  1320.     LOCATE 42, 4
  1321.     COLOR 15, 0
  1322.     PRINT "There ";
  1323.     IF shipLog.currentSurvivors = 1 THEN
  1324.         PRINT "is ";
  1325.     ELSE
  1326.         PRINT "are ";
  1327.     END IF
  1328.     COLOR esplzr.clr, 0
  1329.     PRINT LTRIM$(STR$(shipLog.currentSurvivors));
  1330.     COLOR 15, 0
  1331.     PRINT " survivor";
  1332.     IF shipLog.currentSurvivors <> 1 THEN PRINT "s";
  1333.     PRINT " of ";
  1334.     COLOR esplzr.clr, 0
  1335.     PRINT "20";
  1336.     COLOR 15, 0
  1337.     PRINT " on board."
  1338.     RETURN
  1339.  
  1340.     skipOver:
  1341.     GOSUB showNumOnBoard
  1342.     survivorsAboardDisabledShip = grid(Espializer7.x, Espializer7.y, 3)
  1343.     COLOR 10, 0
  1344.     a$ = "push esc[] to hail the disabled shipk"
  1345.     LOCATE 17, GetCenter(a$) + 5
  1346.     PRINT "Push ";
  1347.     COLOR 14, 0
  1348.     PRINT "[ESC]";
  1349.     COLOR 10, 0
  1350.     PRINT " to hail the disabled ship."
  1351.     CALL WaitForCharacter(CHR$(27))
  1352.     LOCATE 17, GetCenter(a$) + 5
  1353.     PRINT STRING$(LEN(a$), " ")
  1354.     PLAY hail
  1355.     _DELAY hailDelay
  1356.     LOCATE 17, GetCenter(a$)
  1357.     PRINT STRING$(LEN(a$) + 5, " ")
  1358.     COLOR 15, 0
  1359.     a$ = "You tell the captain of the disabled"
  1360.     LOCATE 11, 30
  1361.     PRINT a$
  1362.     a$ = "ship you heard the distress call"
  1363.     b$ = "and have come to help if you can."
  1364.     LOCATE 12, 33
  1365.     PRINT a$
  1366.     LOCATE 13, 33
  1367.     PRINT b$
  1368.     COLOR 11, 0
  1369.     a$ = "The captain asks if you can accommodate"
  1370.     b$ = "# surivior"
  1371.     LOCATE 20, 25
  1372.     PRINT a$
  1373.     LOCATE 21, 27
  1374.     PRINT USING b$; survivorsAboardDisabledShip;
  1375.     IF survivorsAboardDisabledShip <> 1 THEN PRINT "s";
  1376.     PRINT " aboard the Espializer 7."
  1377.     IF shipLog.currentSurvivors = 20 THEN
  1378.         GOTO noRoomOnBoard
  1379.     ELSEIF shipLog.currentSurvivors + survivorsAboardDisabledShip > 20 THEN
  1380.         ableToAccomodate = 20 - shipLog.currentSurvivors
  1381.         grid(Espializer7.x, Espializer7.y, 3) = grid(Espializer7.x, Espializer7.y, 3) - ableToAccomodate
  1382.         COLOR 15, 0
  1383.         a$ = "You tell the captain that your oxygen and similar resources are limited."
  1384.         LOCATE 24, GetCenter(a$)
  1385.         PRINT a$
  1386.         a$ = "You explain you can only accomodate # survivors"
  1387.         b$ = "and will return for the the rest."
  1388.         LOCATE 25, GetCenter(a$)
  1389.         PRINT "You explain you can only accomodate ";
  1390.         COLOR esplzr.clr, 0
  1391.         PRINT LTRIM$(STR$(ableToAccomodate));
  1392.         COLOR 15, 0
  1393.         PRINT " survivor";
  1394.         IF ableToAccomodate <> 1 THEN PRINT "s";
  1395.         LOCATE 26, GetCenter(b$)
  1396.         PRINT b$
  1397.     ELSE
  1398.         ableToAccomodate = grid(Espializer7.x, Espializer7.y, 3)
  1399.         grid(Espializer7.x, Espializer7.y, 3) = 0
  1400.     END IF
  1401.     b$ = " - Type " + CHR$(34) + "BEAM" + CHR$(34) + " to beam # survivors to the Espializer 7."
  1402.     bc = GetCenter(b$)
  1403.     COLOR 15, 0
  1404.     LOCATE 29, bc + 2
  1405.     PRINT " - ";
  1406.     COLOR 10, 0
  1407.     PRINT "Type " + CHR$(34);
  1408.     COLOR 14, 0
  1409.     PRINT "BEAM";
  1410.     COLOR 10, 0
  1411.     PRINT CHR$(34);
  1412.     PRINT " to beam ";
  1413.     COLOR esplzr.clr
  1414.     PRINT LTRIM$(STR$(ableToAccomodate));
  1415.     COLOR 10, 0
  1416.     PRINT " survivor";
  1417.     IF ableToAccomodate <> 1 THEN PRINT "s";
  1418.     PRINT " to the Espializer 7."
  1419.     LOCATE 31, bc + 2
  1420.     PRINT " - ";
  1421.     COLOR 10, 0
  1422.     PRINT "Push ";
  1423.     COLOR 14, 0
  1424.     PRINT "N";
  1425.     COLOR 10, 0
  1426.     PRINT " to ";
  1427.     COLOR 14, 0
  1428.     PRINT "n";
  1429.     COLOR 10, 0
  1430.     PRINT "ot rescue the survivors."
  1431.     DO
  1432.         choice$ = INPUT$(1)
  1433.         choice$ = UCASE$(choice$)
  1434.     LOOP UNTIL choice$ = "B" OR choice$ = "N"
  1435.     SELECT CASE choice$
  1436.         CASE "B"
  1437.             PLAY selectionBeep
  1438.             FOR cnt = 1 TO ableToAccomodate
  1439.                 shipLog.score = shipLog.score + 20
  1440.             NEXT cnt
  1441.             COLOR 13, 0
  1442.             CALL Plot(7, 15, CHR$(2))
  1443.             CALL WaitForCharacter("E")
  1444.             PLAY selectionBeep
  1445.             COLOR 0, 0
  1446.             CALL Plot(7, 15, CHR$(2))
  1447.             COLOR 13, 0
  1448.             CALL Plot(8, 15, CHR$(2)) '            E
  1449.             CALL WaitForCharacter("A")
  1450.             PLAY selectionBeep
  1451.             COLOR 0, 0
  1452.             CALL Plot(8, 15, CHR$(2))
  1453.             COLOR 13, 0
  1454.             CALL Plot(9, 15, CHR$(2)) '            A
  1455.             CALL WaitForCharacter("M")
  1456.             PLAY selectionBeep
  1457.             COLOR 0, 0
  1458.             CALL Plot(9, 15, CHR$(2))
  1459.             COLOR 13, 0
  1460.             CALL Plot(10, 15, CHR$(2))
  1461.             shipLog.currentSurvivors = shipLog.currentSurvivors + ableToAccomodate
  1462.             shipLog.morale = shipLog.morale + (ableToAccomodate * 15)
  1463.             shipLog.totalMorale = shipLog.totalMorale + shipLog.morale
  1464.             shipLog.score = shipLog.score + (ableToAccomodate * 20)
  1465.             COLOR 0, 0
  1466.             ClearStatus
  1467.             GOSUB showNumOnBoard
  1468.             a$ = "Push r to return to the grid."
  1469.             LOCATE 39, GetCenter(a$)
  1470.             COLOR 9, 0
  1471.             PRINT "Push ";
  1472.             COLOR 14, 0
  1473.             PRINT "R";
  1474.             COLOR 9, 0
  1475.             PRINT " to ";
  1476.             COLOR 14, 0
  1477.             PRINT "r";
  1478.             COLOR 9, 0
  1479.             PRINT "eturn to the grid."
  1480.             CALL WaitForCharacter("r")
  1481.             PLAY returnBeep
  1482.         CASE "N"
  1483.             shipLog.score = shipLog.score - 20
  1484.             shipLog.morale = shipLog.morale - 150
  1485.             COLOR 15, 0
  1486.             CLS
  1487.             a$ = "Nobody saw that "
  1488.             LOCATE 30, GetCenter(a$)
  1489.             PRINT a$;
  1490.             _DELAY (hailDelay)
  1491.             PRINT "but. . ."
  1492.             _DELAY (hailDelay * 2)
  1493.             a$ = "your score and morale both decreased"
  1494.             LOCATE 40, GetCenter(a$)
  1495.             PRINT a$
  1496.             PLAY errorBeep
  1497.             _DELAY (4)
  1498.     END SELECT
  1499.     GOTO endAidSub
  1500.     noRoomOnBoard:
  1501.     PRINT
  1502.     PRINT
  1503.     PRINT
  1504.     COLOR 15, 0
  1505.     a$ = "You tell the captain that your oxygen and similar resources are limited."
  1506.     LOCATE 24, GetCenter(a$)
  1507.     PRINT a$
  1508.     PRINT
  1509.     COLOR 15, 0
  1510.     a$ = "You tell the captain you have no room on board."
  1511.     LOCATE , GetCenter(a$)
  1512.     PRINT a$
  1513.     a$ = "You apologize profusely and say you'll be back as soon as you can."
  1514.     LOCATE , GetCenter(a$)
  1515.     PRINT a$
  1516.     a$ = "Push r to return to the grid."
  1517.     LOCATE 45, GetCenter(a$)
  1518.     COLOR 9, 0
  1519.     PRINT "Push ";
  1520.     COLOR 14, 0
  1521.     PRINT "R";
  1522.     COLOR 9, 0
  1523.     PRINT " to ";
  1524.     COLOR 14, 0
  1525.     PRINT "r";
  1526.     COLOR 9, 0
  1527.     PRINT "eturn to the grid."
  1528.     CALL WaitForCharacter("r")
  1529.     PLAY returnBeep
  1530.     endAidSub:
  1531.     CLS
  1532.     CALL PrintGrid
  1533.  
  1534. SUB DrawSarienShip (orientation$, x, y, erased)
  1535.     IF erased = 1 THEN
  1536.         COLOR 0, 0
  1537.     ELSE
  1538.         COLOR sarienShip.clr, 0
  1539.     END IF
  1540.     SELECT CASE orientation$
  1541.         CASE "N"
  1542.             CALL Plot(x - 1, y, t$)
  1543.             CALL Plot(x + 1, y, t$)
  1544.             CALL Plot(x, y - 1, t$)
  1545.         CASE "E"
  1546.             CALL Plot(x, y - 1, t$)
  1547.             CALL Plot(x, y + 1, t$)
  1548.             CALL Plot(x + 1, y, t$)
  1549.         CASE "S"
  1550.             CALL Plot(x - 1, y, t$)
  1551.             CALL Plot(x + 1, y, t$)
  1552.             CALL Plot(x, y + 1, t$)
  1553.         CASE "W"
  1554.             CALL Plot(x - 1, y, t$)
  1555.             CALL Plot(x, y - 1, t$)
  1556.             CALL Plot(x, y + 1, t$)
  1557.     END SELECT
  1558.  
  1559. SUB Battle (singleOrFleet)
  1560.     CLS
  1561.     sarienDamaged = 0
  1562.     GOTO continueBattle
  1563.     printBattleStats:
  1564.     IF sarienDamaged >= 100 OR shipLog.currentDamage.ship >= 100 OR shipLog.currentDamage.medical >= 100 THEN GOTO endBattleSub
  1565.     LOCATE 46, 1
  1566.     COLOR 12, 0
  1567.     PRINT "Damage ";
  1568.     COLOR 15, 0
  1569.     PRINT "and ";
  1570.     COLOR 12, 0
  1571.     PRINT "Injuries"
  1572.     LOCATE 47, 5
  1573.     COLOR 15, 0
  1574.     PRINT "Structural damage: ";
  1575.     COLOR esplzr.clr, 0
  1576.     PRINT LTRIM$(STR$(shipLog.currentDamage.ship)) + "%"
  1577.     LOCATE 48, 5
  1578.     COLOR 15, 0
  1579.     PRINT " Crew incapicated: ";
  1580.     COLOR esplzr.clr, 0
  1581.     PRINT LTRIM$(STR$(shipLog.currentDamage.medical)) + "%"
  1582.     LOCATE 46, 60
  1583.     COLOR sarienShip.clr, 0
  1584.     PRINT "Sarien"
  1585.     LOCATE 47, 50
  1586.     COLOR 15, 0
  1587.     PRINT "Injuries and damage: ";
  1588.     COLOR sarienShip.clr, 0
  1589.     PRINT LTRIM$(STR$(sarienDamaged)) + "%"
  1590.     IF singleOrFleet <> 0 THEN
  1591.         LOCATE 48, 30
  1592.         COLOR 15, 0
  1593.         PRINT "Ships in Fleet: ";
  1594.         COLOR sarienFleet.clr, 0
  1595.         PRINT LTRIM$(STR$(singleOrFleet))
  1596.     END IF
  1597.     RETURN
  1598.     continueBattle:
  1599.     'randomize starting positions
  1600.     wifranBattleX = INT(RND * (75 - 5)) + 5
  1601.     wifranBattleY = INT(RND * (41 - 5)) + 5
  1602.     whichSpin = INT(RND * 4) + 1
  1603.     IF whichSpin = 1 THEN which$ = "N"
  1604.     IF whichSpin = 2 THEN which$ = "S"
  1605.     IF whichSpin = 3 THEN which$ = "W"
  1606.     IF whichSpin = 4 THEN which$ = "E"
  1607.     CALL DrawEspializer7(which$, wifranBattleX, wifranBattleY, 0)
  1608.     wifranIsPointed$ = which$
  1609.     'now to randomly place the Sariens without being too close to the espializer 7
  1610.     getCoordinates:
  1611.     enemyShipX = INT(RND * (77 - 2)) + 2
  1612.     enemyShipY = INT(RND * (44 - 2)) + 2
  1613.     ' create a function that returns true if the espializer7 and the sarien aren't too close and false if they are too close... x,y x,y
  1614.     IF LocationGood(wifranBattleX, wifranBattleY, enemyShipX, enemyShipY) = FALSE THEN GOTO getCoordinates
  1615.     whichSpin = INT(RND * 4) + 1
  1616.     IF whichSpin = 1 THEN sarienOrientation$ = "N"
  1617.     IF whichSpin = 2 THEN sarienOrientation$ = "S"
  1618.     IF whichSpin = 3 THEN sarienOrientation$ = "W"
  1619.     IF whichSpin = 4 THEN sarienOrientation$ = "E"
  1620.     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1621.     GOSUB printBattleStats
  1622.     'now to move them and fire at eachother
  1623.     DO
  1624.         pauseBattle = FALSE
  1625.         previousDirection$ = wifranIsPointed$
  1626.         previousEspializer7x = wifranBattleX
  1627.         previousEspializer7y = wifranBattleY
  1628.         IF sarienDamaged >= 100 OR shipLog.currentDamage.ship >= 100 OR shipLog.currentDamage.medical >= 100 THEN GOTO endBattleSub
  1629.         movementDirection$ = INKEY$
  1630.         SELECT CASE movementDirection$
  1631.             CASE CHR$(0) + "H"
  1632.                 pauseBattle = TRUE
  1633.                 IF wifranBattleY > 5 AND LocationGood(wifranBattleX, wifranBattleY - 1, enemyShipX, enemyShipY) = TRUE THEN
  1634.                     wifranBattleY = wifranBattleY - 1
  1635.                 END IF
  1636.                 wifranIsPointed$ = "N"
  1637.             CASE CHR$(0) + "K"
  1638.                 pauseBattle = TRUE
  1639.                 IF wifranBattleX > 5 AND LocationGood(wifranBattleX - 1, wifranBattleY, enemyShipX, enemyShipY) = TRUE THEN
  1640.                     wifranBattleX = wifranBattleX - 1
  1641.                 END IF
  1642.                 wifranIsPointed$ = "W"
  1643.             CASE CHR$(0) + "P"
  1644.                 pauseBattle = TRUE
  1645.                 IF wifranBattleY < 41 AND LocationGood(wifranBattleX, wifranBattleY + 1, enemyShipX, enemyShipY) = TRUE THEN
  1646.                     wifranBattleY = wifranBattleY + 1
  1647.                 END IF
  1648.                 wifranIsPointed$ = "S"
  1649.             CASE CHR$(0) + "M"
  1650.                 pauseBattle = TRUE
  1651.                 IF wifranBattleX < 76 AND LocationGood(wifranBattleX, wifranBattleY - 1, enemyShipX, enemyShipY) = TRUE THEN
  1652.                     wifranBattleX = wifranBattleX + 1
  1653.                 END IF
  1654.                 wifranIsPointed$ = "E"
  1655.             CASE CHR$(32)
  1656.                 GOSUB fireOnEnemy
  1657.                 GOSUB printBattleStats
  1658.                 _DELAY (movingShipDelay)
  1659.                 GOSUB moveSarienShip
  1660.                 GOSUB sarienfiring
  1661.                 GOSUB printBattleStats
  1662.         END SELECT
  1663.         IF pauseBattle = TRUE THEN
  1664.             CALL DrawEspializer7(previousDirection$, previousEspializer7x, previousEspializer7y, 1)
  1665.             CALL DrawEspializer7(wifranIsPointed$, wifranBattleX, wifranBattleY, 0)
  1666.             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1667.             GOSUB printBattleStats
  1668.             pauseBattle = FALSE
  1669.         END IF
  1670.     LOOP
  1671.     GOTO endBattleSub
  1672.  
  1673.     fireOnEnemy:
  1674.     SELECT CASE wifranIsPointed$
  1675.         CASE "N"
  1676.             PLAY fireBeep
  1677.             IF wifranBattleY > 5 THEN 'fire a bullet up
  1678.                 FOR bulletPosition = wifranBattleY - 5 TO 1 STEP -1
  1679.                     COLOR 14, 0
  1680.                     CALL Plot(wifranBattleX, bulletPosition, t$)
  1681.                     _DELAY (movingShipDelay / 2)
  1682.                     COLOR 0, 0
  1683.                     CALL Plot(wifranBattleX, bulletPosition, t$)
  1684.                     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1685.                     IF IsEnemyHit(wifranBattleX, bulletPosition, enemyShipX, enemyShipY, sarienOrientation$) = TRUE THEN
  1686.                         shipLog.score = shipLog.score + 1
  1687.                         PLAY shipHitBeep
  1688.                         sarienDamaged = sarienDamaged + INT(RND * (50 + shipLog.enemiesDestroyed + 1)) + 1
  1689.                         bulletPosition = 0
  1690.                         CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1691.                         IF sarienDamaged < 100 THEN
  1692.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1693.                         ELSE
  1694.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 1)
  1695.                         END IF
  1696.                         GOSUB printBattleStats
  1697.                     END IF
  1698.                 NEXT bulletPosition
  1699.             END IF
  1700.         CASE "S"
  1701.             IF wifranBattleY < 40 THEN
  1702.                 PLAY fireBeep
  1703.                 FOR bulletPosition = wifranBattleY + 5 TO 45
  1704.                     COLOR 14, 0
  1705.                     CALL Plot(wifranBattleX, bulletPosition, t$)
  1706.                     _DELAY (movingShipDelay / 2)
  1707.                     COLOR 0, 0
  1708.                     CALL Plot(wifranBattleX, bulletPosition, t$)
  1709.                     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1710.                     IF IsEnemyHit(wifranBattleX, bulletPosition, enemyShipX, enemyShipY, sarienOrientation$) = TRUE THEN
  1711.                         shipLog.score = shipLog.score + 1
  1712.                         PLAY shipHitBeep
  1713.                         sarienDamaged = sarienDamaged + INT(RND * (50 + shipLog.enemiesDestroyed + 1)) + 1
  1714.                         bulletPosition = 46
  1715.                         CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1716.                         IF sarienDamaged < 100 THEN
  1717.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1718.                         ELSE
  1719.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 1)
  1720.                         END IF
  1721.                         GOSUB printBattleStats
  1722.                     END IF
  1723.                 NEXT bulletPosition
  1724.             END IF
  1725.         CASE "W"
  1726.             IF wifranBattleX > 5 THEN
  1727.                 PLAY fireBeep
  1728.                 FOR bulletPosition = wifranBattleX - 5 TO 1 STEP -1
  1729.                     COLOR 14, 0
  1730.                     CALL Plot(bulletPosition, wifranBattleY, t$)
  1731.                     _DELAY (movingShipDelay / 2)
  1732.                     COLOR 0, 0
  1733.                     CALL Plot(bulletPosition, wifranBattleY, t$)
  1734.                     IF IsEnemyHit(bulletPosition, wifranBattleY, enemyShipX, enemyShipY, sarienOrientation$) = TRUE THEN
  1735.                         shipLog.score = shipLog.score + 1
  1736.                         PLAY shipHitBeep
  1737.                         sarienDamaged = sarienDamaged + INT(RND * (50 + shipLog.enemiesDestroyed + 1)) + 1
  1738.                         bulletPosition = 0
  1739.                         CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1740.                         IF sarienDamaged < 100 THEN
  1741.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1742.                         ELSE
  1743.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 1)
  1744.                         END IF
  1745.                         GOSUB printBattleStats
  1746.                     END IF
  1747.                 NEXT bulletPosition
  1748.             END IF
  1749.         CASE "E"
  1750.             IF wifranBattleX < 74 THEN
  1751.                 PLAY fireBeep
  1752.                 FOR bulletPosition = wifranBattleX + 5 TO 79 ' sometimes a print at 80 will cause CR
  1753.                     COLOR 14, 0
  1754.                     CALL Plot(bulletPosition, wifranBattleY, t$)
  1755.                     _DELAY (movingShipDelay / 2)
  1756.                     COLOR 0, 0
  1757.                     CALL Plot(bulletPosition, wifranBattleY, t$)
  1758.                     IF IsEnemyHit(bulletPosition, wifranBattleY, enemyShipX, enemyShipY, sarienOrientation$) = TRUE THEN
  1759.                         shipLog.score = shipLog.score + 1
  1760.                         PLAY shipHitBeep
  1761.                         sarienDamaged = sarienDamaged + INT(RND * (50 + shipLog.enemiesDestroyed + 1)) + 1
  1762.                         bulletPosition = 80
  1763.                         CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1764.                         IF sarienDamaged < 100 THEN
  1765.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0) 'why is this not working?
  1766.                         ELSE
  1767.                             CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 1)
  1768.                         END IF
  1769.                         GOSUB printBattleStats
  1770.                     END IF
  1771.                 NEXT bulletPosition
  1772.             END IF
  1773.     END SELECT
  1774.     GOSUB printBattleStats
  1775.     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1776.     RETURN
  1777.  
  1778.     'now to move the sarien ship -- LocationGood helps
  1779.     moveSarienShip:
  1780.     randomX = INT(RND * (76 - 3 + 1)) + 3
  1781.     randomY = INT(RND * (43 - 3 + 1)) + 3
  1782.     rndOrt = INT(RND * (4 - 1 + 1)) + 1
  1783.     SELECT CASE rndOrt
  1784.         CASE 1
  1785.             randomOrientation$ = "N"
  1786.         CASE 2
  1787.             randomOrientation$ = "S"
  1788.         CASE 3
  1789.             randomOrientation$ = "W"
  1790.         CASE 4
  1791.             randomOrientation$ = "E"
  1792.     END SELECT
  1793.     IF sarienDamaged >= 100 THEN RETURN
  1794.     IF LocationGood(wifranBattleX, wifranBattleY, randomX, randomY) = FALSE THEN GOTO moveSarienShip
  1795.     IF SarienWillHit(wifranBattleX, wifranBattleY, randomX, randomY, randomOrientation$) = FALSE THEN GOTO moveSarienShip
  1796.     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 1)
  1797.     enemyShipX = randomX
  1798.     enemyShipY = randomY
  1799.     sarienOrientation$ = randomOrientation$
  1800.     CALL DrawSarienShip(sarienOrientation$, enemyShipX, enemyShipY, 0)
  1801.     GOSUB printBattleStats
  1802.     RETURN
  1803.  
  1804.     'and finally, for the sarien to fire on the espializer 7
  1805.     sarienfiring:
  1806.     IF sarienDamaged >= 100 OR shipLog.currentDamage.medical >= 100 OR shipLog.currentDamage.ship >= 100 THEN RETURN
  1807.     'always hits
  1808.     damageType = INT(RND * 2) + 1
  1809.     damageAmount = INT(RND * 40 - (shipLog.enemiesDestroyed / 1.5)) + 1
  1810.     IF damageType = 1 THEN
  1811.         shipLog.currentDamage.ship = shipLog.currentDamage.ship + damageAmount
  1812.         shipLog.totalDamage.ship = shipLog.totalDamage.ship + damageAmount
  1813.     ELSEIF damageType = 2 THEN
  1814.         shipLog.currentDamage.medical = shipLog.currentDamage.medical + damageAmount
  1815.         shipLog.totalDamage.medical = shipLog.totalDamage.medical + damageAmount
  1816.     END IF
  1817.     _DELAY hailDelay
  1818.     PLAY fireBeep
  1819.     SELECT CASE sarienOrientation$
  1820.         CASE "N"
  1821.             FOR bulletPosition = enemyShipY - 2 TO 1 STEP -1
  1822.                 COLOR 14, 0
  1823.                 CALL Plot(enemyShipX, bulletPosition, t$)
  1824.                 _DELAY (movingShipDelay / 2)
  1825.                 COLOR 0, 0
  1826.                 CALL Plot(enemyShipX, bulletPosition, t$)
  1827.                 IF wifranBattleY = bulletPosition THEN
  1828.                     CALL DrawEspializer7(wifranIsPointed$, wifranBattleX, wifranBattleY, 0)
  1829.                     PLAY shipHitBeep
  1830.                     bulletPosition = 0
  1831.                 END IF
  1832.  
  1833.             NEXT bulletPosition
  1834.         CASE "S"
  1835.             FOR bulletPosition = enemyShipY + 2 TO 45
  1836.                 COLOR 14, 0
  1837.                 CALL Plot(enemyShipX, bulletPosition, t$)
  1838.                 _DELAY (movingShipDelay / 2)
  1839.                 COLOR 0, 0
  1840.                 CALL Plot(enemyShipX, bulletPosition, t$)
  1841.                 IF wifranBattleY = bulletPosition THEN
  1842.                     CALL DrawEspializer7(wifranIsPointed$, wifranBattleX, wifranBattleY, 0)
  1843.                     PLAY shipHitBeep
  1844.                     bulletPosition = 46
  1845.                 END IF
  1846.             NEXT bulletPosition
  1847.         CASE "E"
  1848.             FOR bulletPosition = enemyShipX + 2 TO 80
  1849.                 COLOR 14, 0
  1850.                 CALL Plot(bulletPosition, enemyShipY, t$)
  1851.                 _DELAY (movingShipDelay / 2)
  1852.                 COLOR 0, 0
  1853.                 CALL Plot(bulletPosition, enemyShipY, t$)
  1854.                 IF wifranBattleX = bulletPosition THEN
  1855.                     CALL DrawEspializer7(wifranIsPointed$, wifranBattleX, wifranBattleY, 0)
  1856.                     PLAY shipHitBeep
  1857.                     bulletPosition = 81
  1858.                 END IF
  1859.             NEXT bulletPosition
  1860.         CASE "W"
  1861.             FOR bulletPosition = enemyShipX - 2 TO 1 STEP -1
  1862.                 COLOR 14, 0
  1863.                 CALL Plot(bulletPosition, enemyShipY, t$)
  1864.                 _DELAY (movingShipDelay / 2)
  1865.                 COLOR 0, 0
  1866.                 CALL Plot(bulletPosition, enemyShipY, t$)
  1867.                 IF wifranBattleX = bulletPosition THEN
  1868.                     CALL DrawEspializer7(wifranIsPointed$, wifranBattleX, wifranBattleY, 0)
  1869.                     PLAY shipHitBeep
  1870.                     bulletPosition = 0
  1871.                 END IF
  1872.             NEXT bulletPosition
  1873.     END SELECT
  1874.     GOSUB printBattleStats
  1875.     RETURN
  1876.  
  1877.     endBattleSub:
  1878.     IF sarienDamaged >= 100 THEN
  1879.         CALL Success
  1880.         shipLog.score = shipLog.score + 100
  1881.         shipLog.morale = shipLog.morale + 5
  1882.         shipLog.enemiesDestroyed = shipLog.enemiesDestroyed + 1
  1883.         IF singleOrFleet = 0 THEN
  1884.             grid(Espializer7.x, Espializer7.y, 3) = 0
  1885.         ELSEIF singleOrFleet = 1 THEN ' decrement this so game over
  1886.             CALL EndOfGame
  1887.         ELSE
  1888.             COLOR 0, 0
  1889.             CLS
  1890.             a$ = "You have destroyed the Sarien ship. Push any key to continue."
  1891.             LOCATE 25, GetCenter(a$)
  1892.             COLOR 15, 0
  1893.             PRINT a$
  1894.             hardToLearn$ = INPUT$(1)
  1895.             shipsInSarienFleet = shipsInSarienFleet - 1
  1896.             IF hardToLearn$ = CHR$(27) THEN GOTO exitBattle
  1897.             CALL Battle(shipsInSarienFleet)
  1898.         END IF
  1899.     ELSEIF shipLog.currentDamage.ship >= 100 THEN
  1900.         CALL Boom
  1901.     ELSEIF shipLog.currentDamage.medical >= 100 THEN
  1902.         CALL Boom
  1903.     END IF
  1904.     exitBattle:
  1905.     CLS
  1906.     CALL PrintGrid
  1907.  
  1908. SUB P
  1909.     'used for debugging
  1910.     pause$ = INPUT$(1)
  1911.     IF pause$ = CHR$(27) THEN
  1912.         PLAY errorBeep
  1913.         END
  1914.     END IF
  1915.  
  1916. SUB EndOfGame
  1917.     COLOR 15, 1
  1918.     CLS
  1919.     IF shipLog.ships <> 0 THEN
  1920.         GOTO won
  1921.     ELSE
  1922.         GOTO deadAsAdoornail
  1923.     END IF
  1924.  
  1925.     deadAsAdoornail:
  1926.     COLOR 15, 1
  1927.     CLS
  1928.     a$ = "You failed. Your ship exploded without you aborad so you got a second command. And then a third. And still you didn't go down with your ship. You were demoted to assistant janitor of Roger Wilco. Learn something from him. Anyway, here's what your game looked like."
  1929.     LOCATE 10
  1930.     PRINT LongCenter$(a$)
  1931.     PRINT
  1932.     PRINT
  1933.     lineItUp = GetCenter("total sustained injured damage: ##,###%")
  1934.     COLOR 15, 1
  1935.     LOCATE , lineItUp
  1936.     PRINT "Final score:                        ";
  1937.     COLOR 14, 1
  1938.     PRINT USING "##,###"; shipLog.score
  1939.     COLOR 15, 1
  1940.     LOCATE , lineItUp
  1941.     PRINT "Moves you made:                     ";
  1942.     COLOR 14, 1
  1943.     PRINT USING "##,###"; shipLog.moves
  1944.     COLOR 15, 1
  1945.     LOCATE , lineItUp
  1946.     PRINT "Espializer 7s destroyed:            ";
  1947.     COLOR 14, 1
  1948.     PRINT STR$(3 - shipLog.ships)
  1949.     COLOR 15, 1
  1950.     LOCATE , lineItUp
  1951.     PRINT "Total sustained damage:             ";
  1952.     COLOR 14, 1
  1953.     PRINT USING "##,###%"; shipLog.totalDamage.ship
  1954.     COLOR 15, 1
  1955.     LOCATE , lineItUp
  1956.     PRINT "Total amount of injured crew:       ";
  1957.     COLOR 14, 1
  1958.     PRINT USING "##,###%"; shipLog.totalDamage.medical
  1959.     COLOR 15, 1
  1960.     LOCATE , lineItUp
  1961.     PRINT "People rescued from disbaled ships: ";
  1962.     COLOR 14, 1
  1963.     PRINT USING "##,###"; shipLog.totalSurvivorsSaved
  1964.     COLOR 15, 1
  1965.     LOCATE , lineItUp
  1966.     PRINT "Medical kits used:                  ";
  1967.     COLOR 14, 1
  1968.     PRINT USING "##,###"; shipLog.totalMedSupply
  1969.     COLOR 15, 1
  1970.     LOCATE , lineItUp
  1971.     PRINT "Enemy ships destroyed:              ";
  1972.     COLOR 14, 1
  1973.     PRINT USING "##,###"; shipLog.enemiesDestroyed
  1974.     COLOR 15, 1
  1975.     LOCATE , lineItUp
  1976.     PRINT "Total morale accumulated:           ";
  1977.     COLOR 14, 1
  1978.     PRINT USING "##,###"; shipLog.totalMorale
  1979.     LOCATE 45, GetCenter("Hit any key")
  1980.     COLOR 15, 1
  1981.     PRINT "Hit any key"
  1982.     pause$ = INPUT$(1)
  1983.     addHighScore = TRUE
  1984.     CALL HighScores(addHighScore)
  1985.     CALL MainMenu
  1986.  
  1987.     won:
  1988.     COLOR 13, 11
  1989.     CLS
  1990.     a$ = "Congratualtions!! You have defeated the Sarien fleet."
  1991.     LOCATE 10, GetCenter(a$)
  1992.     PRINT a$
  1993.     PRINT
  1994.     COLOR 10, 11
  1995.     a$ = "Here's what your game looked like."
  1996.     LOCATE , GetCenter(a$)
  1997.     PRINT a$
  1998.     PRINT
  1999.     PRINT
  2000.     lineItUp = GetCenter("total sustained injured damage: ##,###%")
  2001.     COLOR 15, 1
  2002.     LOCATE , lineItUp
  2003.     PRINT "Final score:                        ";
  2004.     COLOR 14, 1
  2005.     PRINT USING "##,###"; shipLog.score
  2006.     COLOR 15, 1
  2007.     LOCATE , lineItUp
  2008.     PRINT "Moves you made:                     ";
  2009.     COLOR 14, 1
  2010.     PRINT USING "##,###"; shipLog.moves
  2011.     COLOR 15, 1
  2012.     LOCATE , lineItUp
  2013.     PRINT "Espializer 7s destroyed:            ";
  2014.     COLOR 14, 1
  2015.     PRINT USING "##,###"; 2 - shipLog.ships
  2016.     COLOR 15, 1
  2017.     LOCATE , lineItUp
  2018.     PRINT "Total sustained damage:             ";
  2019.     COLOR 14, 1
  2020.     PRINT USING "##,###%"; shipLog.totalDamage.ship
  2021.     COLOR 15, 1
  2022.     LOCATE , lineItUp
  2023.     PRINT "Total amount of injured crew:       ";
  2024.     COLOR 14, 1
  2025.     PRINT USING "##,###%"; shipLog.totalDamage.medical
  2026.     COLOR 15, 1
  2027.     LOCATE , lineItUp
  2028.     PRINT "People rescued from disbaled ships: ";
  2029.     COLOR 14, 1
  2030.     PRINT USING "##,###"; shipLog.totalSurvivorsSaved
  2031.     COLOR 15, 1
  2032.     LOCATE , lineItUp
  2033.     PRINT "Medical kits used:                  ";
  2034.     COLOR 14, 1
  2035.     PRINT USING "##,###"; shipLog.totalMedSupply
  2036.     COLOR 15, 1
  2037.     LOCATE , lineItUp
  2038.     PRINT "Enemy ships destroyed:              ";
  2039.     COLOR 14, 1
  2040.     PRINT USING "##,###"; shipLog.enemiesDestroyed
  2041.     COLOR 15, 1
  2042.     LOCATE , lineItUp
  2043.     PRINT "Total morale accumulated:           ";
  2044.     COLOR 14, 1
  2045.     PRINT USING "##,###"; shipLog.totalMorale
  2046.     LOCATE 45, GetCenter("Hit any key")
  2047.     COLOR 15, 1
  2048.     PRINT "Hit any key"
  2049.     pause$ = INPUT$(1)
  2050.     addHighScore = TRUE
  2051.     CALL HighScores(addHighScore)
  2052.     CALL MainMenu
  2053.  
  2054.     endEndOfGameSUB:
  2055.     COLOR 0, 0
  2056.     CLS
  2057.     CALL PrintGrid
  2058.  
  2059. SUB HighScores (addOneToTheList)
  2060.     IF _FILEEXISTS("GGScores.txt") = 0 THEN
  2061.         OPEN "GGScores.txt" FOR OUTPUT AS #1
  2062.         PRINT #1, "              NAME                                 SCORE            Moves "
  2063.         PRINT #1, "             ------                               -------          -------"
  2064.         PRINT #1, "1.       Jimmy McAskill                           10,240            1,240 "
  2065.         PRINT #1, "2.       Tom Hazel                                 5,120              512 "
  2066.         PRINT #1, "3.       Tony Vizcarrondo                          2,560              256 "
  2067.         PRINT #1, "4.       Andrea Thompson                           1,280              128 "
  2068.         PRINT #1, "5.       Frank Smith                                 640               64 "
  2069.         PRINT #1, "6.       Lynette Blood                               320               32 "
  2070.         PRINT #1, "7.       Michelle Landry                             160               16 "
  2071.         PRINT #1, "8.       Justin Dilisio                               80                8 "
  2072.         PRINT #1, "9.       Ryan Sherriff                                40                4 "
  2073.         PRINT #1, "10.      No One Special                               -1                2 "
  2074.         PRINT #1, "EOF"
  2075.         CLOSE #1
  2076.     END IF
  2077.     DIM listOfScores$(1 TO 10)
  2078.     IF addOneToTheList = TRUE THEN
  2079.         GOTO addAscore
  2080.     ELSE
  2081.         GOTO viewScores
  2082.     END IF
  2083.  
  2084.     addAscore:
  2085.     OPEN "GGScores.txt" FOR INPUT AS #1
  2086.     LINE INPUT #1, labels$
  2087.     LINE INPUT #1, hyphens$
  2088.     FOR count = 1 TO 10
  2089.         LINE INPUT #1, listOfScores$(count)
  2090.     NEXT count
  2091.     CLOSE #1
  2092.     DIM name$(1 TO 10)
  2093.     DIM scores(1 TO 10) AS INTEGER
  2094.     DIM move(1 TO 10) AS INTEGER
  2095.     FOR count = 1 TO 10
  2096.         name$(count) = RTRIM$(MID$(listOfScores$(count), 10, 40))
  2097.         leftInt = VAL(MID$(listOfScores$(count), 51, 2))
  2098.         rightInt = VAL(MID$(listOfScores$(count), 54, 3))
  2099.         scores(count) = (leftInt * 1000) + rightInt
  2100.         leftInt = VAL(MID$(listOfScores$(count), 68, 2))
  2101.         rightInt = VAL(MID$(listOfScores$(count), 71, 3))
  2102.         move(count) = (leftInt * 1000) + rightInt
  2103.     NEXT count
  2104.     madeTheList = FALSE
  2105.     IF shipLog.score >= scores(10) THEN
  2106.         GOTO madeList
  2107.     ELSE
  2108.         GOTO viewScores
  2109.     END IF
  2110.  
  2111.     madeList:
  2112.     madeTheList = TRUE
  2113.     rank = 1
  2114.     DO
  2115.         IF shipLog.score < scores(rank) THEN rank = rank + 1
  2116.     LOOP UNTIL shipLog.score >= scores(rank)
  2117.     FOR moveThemDown = 9 TO rank STEP -1
  2118.         scores(moveThemDown + 1) = scores(moveThemDown)
  2119.         name$(moveThemDown + 1) = name$(moveThemDown)
  2120.         move(moveThemDown + 1) = move(moveThemDown)
  2121.     NEXT moveThemDown
  2122.     scores(rank) = shipLog.score
  2123.     COLOR 10, 13
  2124.     CLS
  2125.     COLOR 26, 13
  2126.     a$ = "CONGRATULATIONS!!"
  2127.     LOCATE 17, GetCenter(a$)
  2128.     PRINT a$
  2129.     COLOR 10
  2130.     a$ = "You made the top ten list of scores!"
  2131.     LOCATE 20, GetCenter(a$)
  2132.     PRINT a$
  2133.     PRINT
  2134.     PRINT
  2135.     PRINT
  2136.     INPUT "What is your name"; nm$
  2137.     name$(rank) = nm$
  2138.     move(rank) = shipLog.moves
  2139.  
  2140.     DIM lineToOutput$(1 TO 10)
  2141.     FOR makeThem = 1 TO 10
  2142.         lineToOutput$(makeThem) = LTRIM$(STR$(makeThem)) + "."
  2143.         IF makeThem < 10 THEN lineToOutput$(makeThem) = lineToOutput$(makeThem) + " "
  2144.         lineToOutput$(makeThem) = lineToOutput$(makeThem) + STRING$(6, " ")
  2145.         IF LEN(name$(makeThem)) > 30 THEN name$(makeThem) = LEFT$(name$(makeThem), 30)
  2146.         nm$ = name$(makeThem) + STRING$(30 - LEN(name$(makeThem)), " ")
  2147.         lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2148.         IF scores(makeThem) > 999 THEN
  2149.             leftInt = INT(scores(makeThem) / 1000)
  2150.             nm$ = LTRIM$(STR$(leftInt)) + ","
  2151.             IF leftInt < 10 THEN nm$ = " " + nm$
  2152.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2153.             rightInt = scores(makeThem) - (leftInt * 1000)
  2154.             nm$ = LTRIM$(STR$(rightInt))
  2155.             IF rightInt < 100 AND rightInt >= 10 THEN
  2156.                 nm$ = "0" + nm$
  2157.             ELSEIF rightInt < 10 AND rightInt > 1 THEN
  2158.                 nm$ = "00" + nm$
  2159.             ELSEIF rightInt >= 100 THEN
  2160.                 nm$ = nm$
  2161.             ELSE
  2162.                 nm$ = "000"
  2163.             END IF
  2164.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2165.         ELSE
  2166.             leftInt = 0
  2167.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + "   "
  2168.             nm$ = LTRIM$(STR$(scores(makeThem)))
  2169.             IF scores(makeThem) < 100 AND scores(makeThem) >= 10 THEN
  2170.                 nm$ = " " + nm$
  2171.             ELSEIF scores(makeThem) < 10 THEN
  2172.                 nm$ = nm$
  2173.             END IF
  2174.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2175.  
  2176.         END IF
  2177.         lineToOutput$(makeThem) = lineToOutput$(makeThem) + STRING$(10, " ")
  2178.         IF move(makeThem) > 999 THEN
  2179.             leftInt = INT(move(makeThem) / 1000)
  2180.             nm$ = LTRIM$(STR$(leftInt)) + ","
  2181.             IF leftInt < 10 THEN nm$ = " " + nm$
  2182.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2183.             rightInt = move(makeThem) - (leftInt * 1000)
  2184.             nm$ = LTRIM$(STR$(rightInt))
  2185.             IF rightInt < 100 AND rightInt >= 10 THEN
  2186.                 nm$ = "0" + nm$
  2187.             ELSEIF rightInt < 10 AND rightInt > 1 THEN
  2188.                 nm$ = "00" + nm$
  2189.             ELSEIF rightInt >= 100 THEN
  2190.                 nm$ = nm$
  2191.             ELSE
  2192.                 nm$ = "000"
  2193.             END IF
  2194.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2195.         ELSE
  2196.             leftInt = 0
  2197.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + "   "
  2198.             nm$ = LTRIM$(STR$(move(makeThem)))
  2199.             IF move(makeThem) < 100 AND move(makeThem) >= 10 THEN
  2200.                 nm$ = " " + nm$
  2201.             ELSEIF move(makeThem) < 10 THEN
  2202.                 nm$ = "  " + nm$
  2203.             END IF
  2204.             lineToOutput$(makeThem) = lineToOutput$(makeThem) + nm$
  2205.         END IF
  2206.     NEXT makeThem
  2207.     OPEN "GGScores.txt" FOR OUTPUT AS #1
  2208.     PRINT #1, " Rank         NAME                      SCORE           Moves "
  2209.     PRINT #1, "------       ------                    -------         -------"
  2210.     FOR cnt = 1 TO 10
  2211.         PRINT #1, lineToOutput$(cnt)
  2212.     NEXT cnt
  2213.     CLOSE #1
  2214.  
  2215.     viewScores:
  2216.     COLOR 11, 13
  2217.     CLS
  2218.     OPEN "GGScores.txt" FOR INPUT AS #1
  2219.     LINE INPUT #1, label$
  2220.     LINE INPUT #1, hyphens$
  2221.     LOCATE 14, GetCenter(label$)
  2222.     PRINT label$
  2223.     LOCATE 15, GetCenter(hyphens$)
  2224.     PRINT hyphens$
  2225.     FOR cnt = 1 TO 10
  2226.         LINE INPUT #1, listOfScores$(cnt)
  2227.         IF listOfScores$(cnt) = "EOF" THEN EXIT FOR
  2228.         LOCATE 15 + cnt, GetCenter(listOfScores$(cnt))
  2229.         IF madeTheList = TRUE THEN
  2230.             IF cnt = rank THEN
  2231.                 COLOR 26, 13
  2232.             ELSE
  2233.                 COLOR 11, 13
  2234.             END IF
  2235.         END IF
  2236.         PRINT listOfScores$(cnt)
  2237.     NEXT cnt
  2238.     CLOSE #1
  2239.     PRINT
  2240.     PRINT "Push any key to continue or Escape to end."
  2241.     CALL P
  2242.     CALL MainMenu
  2243.  
  2244. SUB Instruct
  2245.     COLOR 15, 0
  2246.     CLS
  2247.     a$ = "Use the arrow keys to move. You command the"
  2248.     c$ = "Espializer 7, the Flagship of the Wifrans."
  2249.     b$ = "On the Galaxy Grid you are represented by G."
  2250.     LOCATE 14, GetCenter(a$)
  2251.     PRINT a$
  2252.     LOCATE 15, GetCenter(c$)
  2253.     PRINT c$
  2254.     LOCATE 16, GetCenter(b$)
  2255.     PRINT "On the Galaxy Grid you are represented by ";
  2256.     COLOR esplzr.clr, 0
  2257.     PRINT CHR$(esplzr.code);
  2258.     COLOR 15, 0
  2259.     PRINT "."
  2260.     a$ = "You begin at the top left of the screen. The top left (x, y)"
  2261.     b$ = "coordinates are 1, 1. The bottom right is 80, 45"
  2262.     LOCATE 18, GetCenter(a$)
  2263.     PRINT a$
  2264.     LOCATE 19, GetCenter(b$)
  2265.     PRINT b$
  2266.     a$ = "Visiting the informants (o) is recommended."
  2267.     LOCATE 22, GetCenter(a$)
  2268.     PRINT "Visiting the informants (";
  2269.     COLOR informant.clr
  2270.     PRINT CHR$(informant.code);
  2271.     COLOR 15, 0
  2272.     PRINT ") is recommended."
  2273.     a$ = "There is an optional 10 question multiple choice quiz on the"
  2274.     b$ = "information they give. Push [SPACEBAR] to take the quiz."
  2275.     LOCATE 23, GetCenter(a$)
  2276.     PRINT a$
  2277.     LOCATE 24, GetCenter(b$)
  2278.     PRINT b$
  2279.     PRINT
  2280.     PRINT
  2281.     PRINT LongCenter("Your goal is to locate and destroy the Sarien Fleet. In order to win, you must defeat all of the ships in the fleet. There are also lone Sarien ships you may engage for a higher score. You can visit Space Stations to repair damage to your ship and heal your injured crewmates.")
  2282.  
  2283.  
  2284.     PRINT
  2285.     PRINT
  2286.     PRINT
  2287.     PRINT
  2288.     PRINT
  2289.     PRINT
  2290.     PRINT
  2291.     PRINT
  2292.     LOCATE , GetCenter("Push any key to continue or [ESC] to end.")
  2293.     PRINT "Push any key to continue or [ESC] to end."
  2294.     CALL P
  2295.     CALL MainMenu
  2296.  
  2297. SUB MainMenu
  2298.     COLOR 11, 1
  2299.     CLS
  2300.     IF beenToMenu = 0 THEN _DELAY (1)
  2301.     IF beenToMenu = 0 THEN
  2302.         PLAY "MBL60O1CDEFGABO2CDEFGAB"
  2303.     END IF
  2304.     titleString$ = "The Galaxy Grid"
  2305.     FOR counting = 1 TO LEN(titleString$)
  2306.         LOCATE 12, 27 + counting
  2307.         PRINT MID$(titleString$, counting, 1)
  2308.         LOCATE 13, 27 + counting
  2309.         PRINT "-"
  2310.         IF beenToMenu = 0 THEN _DELAY 0.04
  2311.     NEXT counting
  2312.     PRINT
  2313.     COLOR 15, 1
  2314.     PRINT
  2315.     PRINT
  2316.     IF beenToMenu = 0 THEN _DELAY 0.2
  2317.     wrongNumber:
  2318.     LOCATE 16, 1
  2319.     PRINT "                           1.  Dedication"
  2320.     PRINT
  2321.     PRINT "                           2.  Instructions"
  2322.     PRINT
  2323.     PRINT "                           3.  Start a New Game"
  2324.     PRINT
  2325.     IF gameInProgress = 0 THEN COLOR 7, 1
  2326.     PRINT "                           4.  Save Current Game"
  2327.     COLOR 15, 1
  2328.     PRINT
  2329.     PRINT "                           5.  Load Saved Game"
  2330.     COLOR 15, 1
  2331.     PRINT
  2332.     IF gameInProgress = 0 THEN COLOR 7, 1
  2333.     PRINT "                           6.  Return to Game"
  2334.     COLOR 15, 1
  2335.     PRINT
  2336.     PRINT "                           7.  View High Scores"
  2337.     PRINT
  2338.     PRINT "                           8.  End"
  2339.     PRINT
  2340.     PRINT
  2341.     PRINT
  2342.     PLAY "L30O3F"
  2343.     DO
  2344.         LOCATE 24
  2345.         ch$ = INPUT$(1)
  2346.         z = VAL(ch$)
  2347.         IF gameInProgress = 0 THEN
  2348.             IF z = 1 OR z = 2 OR z = 3 OR z = 5 OR z = 7 THEN
  2349.                 PLAY selectionBeep
  2350.                 GOTO implementCommand
  2351.             ELSEIF z = 4 OR z = 6 THEN
  2352.                 PLAY errorBeep
  2353.             END IF
  2354.         ELSE
  2355.             IF z >= 1 AND z <= 8 THEN GOTO implementCommand
  2356.             PLAY selectionBeep
  2357.         END IF
  2358.         implementCommand:
  2359.         beenToMenu = 1
  2360.         SELECT CASE ch$
  2361.             CASE "2" '       Instructions
  2362.                 CALL Instruct
  2363.             CASE "3" '       New Game
  2364.                 IF gameInProgress = 0 THEN
  2365.  
  2366.                     CALL PlayGalaxyGrid("N")
  2367.                 ELSE
  2368.                     CALL PlayGalaxyGrid("Y")
  2369.                 END IF
  2370.             CASE "4" '        Save Current Game
  2371.                 IF gameInProgress = 1 THEN CALL SaveGame
  2372.             CASE "5" '        Load
  2373.                 CALL LoadSavedGame
  2374.             CASE "6" '        Return to Current Game
  2375.                 IF gameInProgress = 1 THEN
  2376.                     COLOR 15, 0
  2377.                     CLS
  2378.                     CALL PlayGalaxyGrid("Y")
  2379.                 END IF
  2380.             CASE "7" '        See Scores
  2381.                 CALL HighScores(FALSE)
  2382.             CASE "1" '        Dedication
  2383.                 CALL Dedication
  2384.             CASE "8" '        END
  2385.                 PLAY errorBeep
  2386.                 END
  2387.         END SELECT
  2388.     LOOP UNTIL ch$ = "8"
  2389.  
  2390. SUB Success
  2391.     PLAY successBeep
  2392.     COLOR 14, 1
  2393.     CLS
  2394.     x = 1
  2395.     y = 1
  2396.     l$ = CHR$(219)
  2397.     COLOR 4, 1
  2398.     GOSUB makeAnS
  2399.     l$ = t$
  2400.     COLOR 6, 1
  2401.     GOSUB makeAu
  2402.     x = 23
  2403.     y = 1
  2404.     COLOR 14, 1
  2405.     l$ = t$
  2406.     GOSUB makeAc
  2407.     x = 34
  2408.     y = 5
  2409.     COLOR 10, 1
  2410.     l$ = t$
  2411.     GOSUB makeAc
  2412.     l$ = t$
  2413.     COLOR 11, 1
  2414.     GOSUB makeAnE
  2415.     x = 56
  2416.     y = 5
  2417.     l$ = CHR$(219)
  2418.     COLOR 5, 1
  2419.     GOSUB makeAnS
  2420.     x = 67
  2421.     y = 1
  2422.     l$ = CHR$(219)
  2423.     COLOR 12, 1
  2424.     GOSUB makeAnS
  2425.     GOTO done
  2426.     makeAnS:
  2427.     CALL VerticalLine(y + 5, y + 10, x, l$)
  2428.     CALL VerticalLine(y + 34, y + 36, x, l$)
  2429.     CALL VerticalLine(y + 4, y + 7, x + 1, l$)
  2430.     CALL VerticalLine(y + 4, y + 7, x + 2, l$)
  2431.     CALL VerticalLine(y + 9, y + 13, x + 1, l$)
  2432.     CALL VerticalLine(y + 10, y + 13, x + 2, l$)
  2433.     CALL VerticalLine(y + 34, y + 38, x + 1, l$)
  2434.     CALL VerticalLine(y + 36, y + 38, x + 2, l$)
  2435.     CALL Plot(x + 1, y + 37, l$)
  2436.     CALL Plot(x + 2, y + 3, l$)
  2437.     CALL Plot(x + 3, y + 3, l$)
  2438.     CALL Plot(x + 2, y + 2, l$)
  2439.     CALL VerticalLine(y + 14, y + 16, x + 2, l$)
  2440.     CALL HorizontalLine(x + 2, x + 5, y + 39, l$)
  2441.     CALL Plot(x + 5, y + 38, l$)
  2442.     CALL Plot(x + 3, y + 38, l$)
  2443.     CALL HorizontalLine(x + 3, x + 7, y + 1, l$)
  2444.     CALL HorizontalLine(x + 3, x + 7, y + 2, l$)
  2445.     CALL Plot(x + 7, y + 3, l$)
  2446.     CALL VerticalLine(y + 14, y + 17, x + 3, l$)
  2447.     CALL Plot(x + 4, y + 16, l$)
  2448.     CALL Plot(x + 1, y + 8, l$)
  2449.     CALL VerticalLine(y + 17, y + 19, x + 4, l$)
  2450.     CALL VerticalLine(y + 17, y + 20, x + 5, l$)
  2451.     CALL VerticalLine(y + 19, y + 21, x + 6, l$)
  2452.     CALL VerticalLine(y + 36, y + 38, x + 6, l$)
  2453.     CALL VerticalLine(y + 21, y + 23, x + 7, l$)
  2454.     CALL VerticalLine(y + 33, y + 37, x + 7, l$)
  2455.     CALL Plot(x + 8, y + 2, l$)
  2456.     CALL Plot(x + 8, y + 3, l$)
  2457.     CALL VerticalLine(y + 22, y + 26, x + 8, l$)
  2458.     CALL VerticalLine(y + 31, y + 35, x + 8, l$)
  2459.     CALL VerticalLine(y + 4, y + 5, x + 8, l$)
  2460.     CALL VerticalLine(y + 4, y + 5, x + 9, l$)
  2461.     CALL VerticalLine(y + 24, y + 32, x + 9, l$)
  2462.     RETURN
  2463.  
  2464.     makeAu:
  2465.     CALL VerticalLine(7, 17, 12, l$)
  2466.     CALL VerticalLine(7, 17, 13, l$)
  2467.     CALL VerticalLine(7, 17, 21, l$)
  2468.     CALL VerticalLine(7, 17, 20, l$)
  2469.     CALL VerticalLine(18, 39, 13, l$)
  2470.     CALL VerticalLine(18, 39, 14, l$)
  2471.     CALL VerticalLine(18, 39, 19, l$)
  2472.     CALL VerticalLine(18, 39, 20, l$)
  2473.     CALL VerticalLine(40, 43, 14, l$)
  2474.     CALL VerticalLine(40, 43, 19, l$)
  2475.     CALL HorizontalLine(15, 18, 44, l$)
  2476.     CALL Plot(15, 42, l$)
  2477.     CALL Plot(18, 42, l$)
  2478.     CALL HorizontalLine(15, 18, 43, l$)
  2479.     RETURN
  2480.  
  2481.     makeAc:
  2482.     CALL Plot(x + 2, y + 7, l$)
  2483.     CALL Plot(x + 3, y + 6, l$)
  2484.     CALL VerticalLine(y + 8, y + 32, x, l$)
  2485.     CALL VerticalLine(y + 6, y + 35, x + 1, l$)
  2486.     CALL VerticalLine(y + 6, y + 10, x + 1, l$)
  2487.     CALL VerticalLine(y + 31, y + 34, x + 1, l$)
  2488.     CALL VerticalLine(y + 4, y + 6, x + 2, l$)
  2489.     CALL VerticalLine(y + 4, y + 6, x + 3, l$)
  2490.     CALL VerticalLine(y + 33, y + 38, x + 2, l$)
  2491.     CALL Plot(x + 3, y + 3, l$)
  2492.     CALL Plot(x + 3, y + 38, l$)
  2493.     CALL Plot(x + 3, y + 37, l$)
  2494.     CALL Plot(x + 3, y + 36, l$)
  2495.     CALL HorizontalLine(x + 4, x + 8, y + 2, l$)
  2496.     CALL HorizontalLine(x + 4, x + 8, y + 3, l$)
  2497.     CALL HorizontalLine(x + 4, x + 8, y + 39, l$)
  2498.     CALL Plot(x + 4, y + 37, l$)
  2499.     CALL HorizontalLine(x + 4, x + 8, y + 38, l$)
  2500.     CALL Plot(x + 9, y + 3, l$)
  2501.     CALL Plot(x + 9, y + 38, l$)
  2502.     RETURN
  2503.  
  2504.     makeAnE:
  2505.     CALL VerticalLine(3, 40, 45, l$)
  2506.     CALL VerticalLine(3, 40, 46, l$)
  2507.     CALL HorizontalLine(45, 54, 3, l$)
  2508.     CALL HorizontalLine(45, 54, 4, l$)
  2509.     CALL HorizontalLine(45, 52, 21, l$)
  2510.     CALL HorizontalLine(45, 53, 22, l$)
  2511.     CALL HorizontalLine(45, 54, 40, l$)
  2512.     CALL HorizontalLine(45, 54, 39, l$)
  2513.     RETURN
  2514.  
  2515.     done:
  2516.     _DELAY (2)
  2517.     COLOR 0, 0
  2518.     CLS
  2519.  
  2520.  
  2521. FUNCTION SarienWillHit (goodGuysX, goodGuysY, badX, badY, badOrientation$)
  2522.     SELECT CASE badOrientation$
  2523.         CASE "N"
  2524.             IF goodGuysX - 3 < badX AND badX < goodGuysX + 3 AND badY > goodGuysY THEN
  2525.                 rtn = TRUE
  2526.             ELSE
  2527.                 rtn = FALSE
  2528.             END IF
  2529.         CASE "S"
  2530.             IF goodGuysX - 3 < badX AND badX < goodGuysX + 3 AND badY < goodGuysY THEN
  2531.                 rtn = TRUE
  2532.             ELSE
  2533.                 rtn = FALSE
  2534.             END IF
  2535.         CASE "E"
  2536.             IF goodGuysY - 3 < badY AND badY < goodGuysY AND badX < goodGuysX THEN
  2537.                 rtn = TRUE
  2538.             ELSE
  2539.                 rtn = FALSE
  2540.             END IF
  2541.         CASE "W"
  2542.             IF goodGuysY - 3 < badY AND badY < goodGuysY AND badX > goodGuysX THEN
  2543.                 rtn = TRUE
  2544.             ELSE
  2545.                 rtn = FALSE
  2546.             END IF
  2547.     END SELECT
  2548.     SarienWillHit = rtn
  2549.  
  2550. FUNCTION IsEnemyHit (bulletX, bulletY, enemyX, enemyY, enemyOrientation$)
  2551.     SELECT CASE enemyOrientation$
  2552.         CASE "N"
  2553.             IF bulletX = enemyX - 1 AND bulletY = enemyY THEN
  2554.                 enemyIsHit = TRUE
  2555.             ELSEIF bulletX = enemyX AND bulletY = enemyY - 1 THEN
  2556.                 enemyIsHit = TRUE
  2557.             ELSEIF bulletX = enemyX + 1 AND bulletY = enemyY THEN
  2558.                 enemyIsHit = TRUE
  2559.             ELSE
  2560.                 enemyIsHit = FALSE
  2561.             END IF
  2562.         CASE "W"
  2563.             IF bulletX = enemyX AND bulletY = enemyY - 1 THEN
  2564.                 enemyIsHit = TRUE
  2565.             ELSEIF bulletX = enemyX - 1 AND bulletY = enemyY THEN
  2566.                 enemyIsHit = TRUE
  2567.             ELSEIF bulletX = enemyX AND bulletY = enemyY + 1 THEN
  2568.                 enemyIsHit = TRUE
  2569.             ELSE
  2570.                 enemyIsHit = FALSE
  2571.             END IF
  2572.         CASE "S"
  2573.             IF bulletX = enemyX - 1 AND bulletY = enemyY THEN
  2574.                 enemyIsHit = TRUE
  2575.             ELSEIF bulletX = enemyX AND bulletY = enemyY + 1 THEN
  2576.                 enemyIsHit = TRUE
  2577.             ELSEIF bulletX = enemyX + 1 AND bulletY = enemyY THEN
  2578.                 enemyIsHit = TRUE
  2579.             ELSE
  2580.                 enemyIsHit = FALSE
  2581.             END IF
  2582.         CASE "E"
  2583.             IF bulletX = enemyX AND bulletY = enemyY - 1 THEN
  2584.                 enemyIsHit = TRUE
  2585.             ELSEIF bulletX = enemyX + 1 AND bulletY = enemyY THEN
  2586.                 enemyIsHit = TRUE
  2587.             ELSEIF bulletX = enemyX AND bulletY = enemyY + 1 THEN
  2588.                 enemyIsHit = TRUE
  2589.             ELSE
  2590.                 enemyIsHit = FALSE
  2591.             END IF
  2592.     END SELECT
  2593.     IsEnemyHit = enemyIsHit
  2594.  
  2595. FUNCTION LocationGood (wifranEspializer7x, wifranEspializer7y, badGuysX, badGuysY)
  2596.     wifLeftBorder = wifranEspializer7x - 30
  2597.     wifTopBorder = wifranEspializer7y - 20
  2598.     wifRightBorder = wifranEspializer7x + 30
  2599.     wifBottomBorder = wifranEspializer7y + 20
  2600.     IF wifLeftBorder < badGuysX AND badGuysX < wifRightBorder AND wifTopBorder < badGuysY AND badGuysY < wifBottomBorder THEN
  2601.         placementOK = FALSE
  2602.     ELSE
  2603.         placementOK = TRUE
  2604.     END IF
  2605.     LocationGood = placementOK
  2606.  
  2607. SUB WaitForCharacter (character$)
  2608.     DO
  2609.         readCharacter$ = INKEY$
  2610.         character$ = UCASE$(character$)
  2611.         readCharacter$ = UCASE$(readCharacter$)
  2612.     LOOP UNTIL readCharacter$ = character$
  2613.  
  2614. FUNCTION GetCenter (text$)
  2615.     GetCenter = (80 - LEN(text$)) / 2
  2616.  
  2617. SUB UseWormHole
  2618.     DIM startingHole AS coordinate
  2619.     startingHole.x = Espializer7.x
  2620.     startingHole.y = Espializer7.y
  2621.     wormHoleLetter$ = CHR$(grid(Espializer7.x, Espializer7.y, 1))
  2622.     FOR findingX = 1 TO 80
  2623.         FOR findingY = 1 TO 45
  2624.             IF grid(findingX, findingY, 1) = ASC(wormHoleLetter$) THEN
  2625.                 IF NOT (startingHole.x = findingX AND startingHole.y = findingY) THEN
  2626.                     newX = findingX
  2627.                     newY = findingY
  2628.                 END IF
  2629.             END IF
  2630.         NEXT findingY
  2631.     NEXT findingX
  2632.  
  2633.     GOSUB drawCircles
  2634.     CALL DrawEspializer7("N", 41, 44, FALSE) ' true / false whether to erase the ship.
  2635.     COLOR 10, 0
  2636.     LOCATE 1, 1
  2637.     PRINT "Push ";
  2638.     COLOR 14, 0
  2639.     PRINT "[SPACEBAR]";
  2640.     COLOR 10, 0
  2641.     PRINT " to move the"
  2642.     PRINT "    Espializer 7 into"
  2643.     PRINT "      the wormhole."
  2644.     CALL WaitForCharacter(" ")
  2645.     LOCATE 1, 1
  2646.     PRINT "                           "
  2647.     PRINT "                     "
  2648.     PRINT "                   "
  2649.     'move the espializer 7 into the wormhole
  2650.     PLAY movingShipBeep$
  2651.     FOR yPosition = 44 TO 22 STEP -1
  2652.         CALL DrawEspializer7("N", 41, yPosition, FALSE)
  2653.         _DELAY (movingShipDelay * 2)
  2654.         IF yPosition MOD (movingShipMod / 2) = 0 THEN PLAY movingShipBeep$
  2655.         CALL DrawEspializer7("N", 41, yPosition, TRUE)
  2656.         GOSUB drawCircles
  2657.     NEXT yPosition
  2658.  
  2659.     CALL DrawEspializer7("S", 41, yPosition, TRUE)
  2660.     GOSUB drawCircles
  2661.     _DELAY (hailDelay / 2)
  2662.  
  2663.  
  2664.     'set the espializer at the new hole
  2665.     Espializer7.x = newX
  2666.     Espializer7.y = newY
  2667.     LOCATE 1, 1
  2668.     COLOR 15, 0
  2669.     CALL DrawEspializer7("S", 41, 22, FALSE)
  2670.     PLAY movingShipBeep$
  2671.     FOR yPosition = 22 TO 44
  2672.         CALL DrawEspializer7("S", 41, yPosition, FALSE)
  2673.         _DELAY (movingShipDelay * 2)
  2674.         IF yPosition MOD (movingShipMod / 2) = 0 THEN PLAY movingShipBeep$
  2675.         CALL DrawEspializer7("S", 41, yPosition, TRUE)
  2676.         GOSUB drawCircles
  2677.     NEXT yPosition
  2678.     LOCATE 1, 1
  2679.     PRINT "                        "
  2680.     PRINT "                  "
  2681.     PRINT "                    "
  2682.     COLOR 10, 0
  2683.     LOCATE 1, 1
  2684.     PRINT "Push ";
  2685.     COLOR 14, 0
  2686.     PRINT CHR$(34) + "R" + CHR$(34);
  2687.     COLOR 10, 0
  2688.     PRINT " to ";
  2689.     COLOR 14, 0
  2690.     PRINT "r";
  2691.     COLOR 10, 0
  2692.     PRINT "eturn"
  2693.     PRINT "to the Galaxy Grid at"
  2694.     PRINT "coordinates (";
  2695.     COLOR esplzr.clr, 0
  2696.     PRINT LTRIM$(STR$(Espializer7.x));
  2697.     COLOR 10, 0
  2698.     PRINT ", ";
  2699.     COLOR esplzr.clr, 0
  2700.     PRINT LTRIM$(STR$(Espializer7.y));
  2701.     COLOR 10, 0
  2702.     PRINT ")"
  2703.     CALL WaitForCharacter("r")
  2704.     GOTO endWormHoleSUB
  2705.  
  2706.     drawCircles:
  2707.     COLOR 13, 0
  2708.     ' outer most circle
  2709.     CALL HorizontalLine(36, 44, 1, t$)
  2710.     CALL HorizontalLine(33, 35, 2, t$)
  2711.     CALL HorizontalLine(30, 32, 3, t$)
  2712.     CALL HorizontalLine(28, 29, 4, t$)
  2713.     CALL HorizontalLine(26, 27, 5, t$)
  2714.     CALL HorizontalLine(24, 25, 6, t$)
  2715.     CALL Plot(23, 7, t$)
  2716.     CALL Plot(22, 8, t$)
  2717.     CALL VerticalLine(9, 10, 21, t$)
  2718.     CALL Plot(20, 11, t$)
  2719.     CALL VerticalLine(12, 13, 19, t$)
  2720.     CALL VerticalLine(14, 15, 18, t$)
  2721.     CALL VerticalLine(16, 18, 17, t$)
  2722.     CALL VerticalLine(19, 30, 16, t$)
  2723.     CALL VerticalLine(31, 33, 17, t$)
  2724.     CALL VerticalLine(34, 35, 18, t$)
  2725.     CALL VerticalLine(36, 37, 19, t$)
  2726.     CALL Plot(20, 38, t$)
  2727.     CALL VerticalLine(39, 40, 21, t$)
  2728.     CALL Plot(22, 41, t$)
  2729.     CALL Plot(23, 42, t$)
  2730.     CALL HorizontalLine(24, 25, 43, t$)
  2731.     CALL HorizontalLine(26, 27, 44, t$)
  2732.     CALL HorizontalLine(28, 29, 45, t$)
  2733.     CALL HorizontalLine(30, 32, 46, t$)
  2734.     CALL HorizontalLine(33, 35, 47, t$)
  2735.     CALL HorizontalLine(36, 44, 48, t$)
  2736.     CALL HorizontalLine(45, 47, 2, t$)
  2737.     CALL HorizontalLine(48, 50, 3, t$)
  2738.     CALL HorizontalLine(51, 52, 4, t$)
  2739.     CALL HorizontalLine(53, 54, 5, t$)
  2740.     CALL HorizontalLine(55, 56, 6, t$)
  2741.     CALL Plot(57, 7, t$)
  2742.     CALL Plot(58, 8, t$)
  2743.     CALL VerticalLine(9, 10, 59, t$)
  2744.     CALL Plot(60, 11, t$)
  2745.     CALL VerticalLine(12, 13, 61, t$)
  2746.     CALL VerticalLine(14, 15, 62, t$)
  2747.     CALL VerticalLine(16, 18, 63, t$)
  2748.     CALL VerticalLine(19, 30, 64, t$)
  2749.     CALL VerticalLine(31, 33, 63, t$)
  2750.     CALL VerticalLine(34, 35, 62, t$)
  2751.     CALL VerticalLine(36, 37, 61, t$)
  2752.     CALL Plot(60, 38, t$)
  2753.     CALL VerticalLine(39, 40, 59, t$)
  2754.     CALL Plot(58, 41, t$)
  2755.     CALL Plot(57, 42, t$)
  2756.     CALL HorizontalLine(55, 56, 43, t$)
  2757.     CALL HorizontalLine(53, 54, 44, t$)
  2758.     CALL HorizontalLine(51, 52, 45, t$)
  2759.     CALL HorizontalLine(48, 50, 46, t$)
  2760.     CALL HorizontalLine(45, 47, 47, t$)
  2761.  
  2762.     'Second circle
  2763.     CALL HorizontalLine(38, 44, 6, t$) 'top
  2764.     CALL HorizontalLine(38, 44, 43, t$) 'bottom
  2765.     CALL HorizontalLine(34, 37, 7, t$)
  2766.     CALL HorizontalLine(34, 37, 42, t$)
  2767.     CALL HorizontalLine(45, 48, 42, t$)
  2768.     CALL HorizontalLine(45, 48, 7, t$)
  2769.     CALL HorizontalLine(32, 33, 8, t$)
  2770.     CALL HorizontalLine(49, 50, 8, t$)
  2771.     CALL HorizontalLine(32, 33, 41, t$)
  2772.     CALL HorizontalLine(49, 50, 41, t$)
  2773.     CALL Plot(31, 9, t$)
  2774.     CALL Plot(51, 9, t$)
  2775.     CALL Plot(31, 40, t$)
  2776.     CALL Plot(51, 40, t$)
  2777.     CALL HorizontalLine(29, 30, 10, t$)
  2778.     CALL HorizontalLine(52, 53, 10, t$)
  2779.     CALL HorizontalLine(29, 30, 39, t$)
  2780.     CALL HorizontalLine(52, 53, 39, t$)
  2781.     CALL Plot(28, 11, t$)
  2782.     CALL Plot(54, 11, t$)
  2783.     CALL Plot(28, 38, t$)
  2784.     CALL Plot(54, 38, t$)
  2785.     CALL Plot(27, 12, t$)
  2786.     CALL Plot(55, 12, t$)
  2787.     CALL Plot(27, 37, t$)
  2788.     CALL Plot(55, 37, t$)
  2789.     CALL VerticalLine(13, 14, 26, t$)
  2790.     CALL VerticalLine(13, 14, 56, t$)
  2791.     CALL VerticalLine(35, 36, 26, t$)
  2792.     CALL VerticalLine(35, 36, 56, t$)
  2793.     CALL VerticalLine(15, 16, 25, t$)
  2794.     CALL VerticalLine(15, 16, 57, t$)
  2795.     CALL VerticalLine(33, 34, 25, t$)
  2796.     CALL VerticalLine(33, 34, 57, t$)
  2797.     CALL VerticalLine(17, 18, 24, t$)
  2798.     CALL VerticalLine(17, 18, 58, t$)
  2799.     CALL VerticalLine(31, 32, 24, t$)
  2800.     CALL VerticalLine(31, 32, 58, t$)
  2801.     CALL VerticalLine(19, 22, 23, t$)
  2802.     CALL VerticalLine(19, 22, 59, t$)
  2803.     CALL VerticalLine(27, 30, 23, t$)
  2804.     CALL VerticalLine(27, 30, 59, t$)
  2805.     CALL VerticalLine(23, 26, 22, t$)
  2806.     CALL VerticalLine(23, 26, 60, t$)
  2807.  
  2808.     'Third circle
  2809.     CALL HorizontalLine(39, 43, 11, t$) 'top
  2810.     CALL HorizontalLine(39, 43, 38, t$) 'bottom
  2811.     CALL HorizontalLine(36, 38, 12, t$)
  2812.     CALL HorizontalLine(44, 46, 12, t$)
  2813.     CALL HorizontalLine(36, 38, 37, t$)
  2814.     CALL HorizontalLine(44, 46, 37, t$)
  2815.     CALL HorizontalLine(34, 35, 13, t$)
  2816.     CALL HorizontalLine(47, 48, 13, t$)
  2817.     CALL HorizontalLine(34, 35, 36, t$)
  2818.     CALL HorizontalLine(47, 48, 36, t$)
  2819.     CALL Plot(33, 14, t$)
  2820.     CALL Plot(49, 14, t$)
  2821.     CALL Plot(33, 35, t$)
  2822.     CALL Plot(49, 35, t$)
  2823.     CALL Plot(32, 15, t$)
  2824.     CALL Plot(50, 15, t$)
  2825.     CALL Plot(32, 34, t$)
  2826.     CALL Plot(50, 34, t$)
  2827.     CALL Plot(31, 16, t$)
  2828.     CALL Plot(51, 16, t$)
  2829.     CALL Plot(31, 33, t$)
  2830.     CALL Plot(51, 33, t$)
  2831.     CALL Plot(30, 17, t$)
  2832.     CALL Plot(52, 17, t$)
  2833.     CALL Plot(30, 32, t$)
  2834.     CALL Plot(52, 32, t$)
  2835.     CALL VerticalLine(18, 19, 29, t$)
  2836.     CALL VerticalLine(18, 19, 53, t$)
  2837.     CALL VerticalLine(30, 31, 29, t$)
  2838.     CALL VerticalLine(30, 31, 53, t$)
  2839.     CALL VerticalLine(20, 22, 28, t$)
  2840.     CALL VerticalLine(20, 22, 54, t$)
  2841.     CALL VerticalLine(27, 29, 28, t$)
  2842.     CALL VerticalLine(27, 29, 54, t$)
  2843.     CALL VerticalLine(23, 26, 27, t$)
  2844.     CALL VerticalLine(23, 26, 55, t$)
  2845.  
  2846.     'inner most circle
  2847.     CALL HorizontalLine(39, 44, 16, t$)
  2848.     CALL HorizontalLine(39, 44, 34, t$)
  2849.     CALL HorizontalLine(37, 38, 17, t$)
  2850.     CALL HorizontalLine(45, 46, 17, t$)
  2851.     CALL HorizontalLine(37, 38, 33, t$)
  2852.     CALL HorizontalLine(45, 46, 33, t$)
  2853.     CALL HorizontalLine(35, 36, 18, t$)
  2854.     CALL HorizontalLine(47, 48, 18, t$)
  2855.     CALL HorizontalLine(35, 36, 32, t$)
  2856.     CALL HorizontalLine(47, 48, 32, t$)
  2857.     CALL VerticalLine(19, 22, 34, t$)
  2858.     CALL VerticalLine(19, 22, 49, t$)
  2859.     CALL VerticalLine(28, 31, 34, t$)
  2860.     CALL VerticalLine(28, 31, 49, t$)
  2861.     CALL Plot(33, 23, t$)
  2862.     CALL Plot(50, 23, t$)
  2863.     CALL Plot(33, 27, t$)
  2864.     CALL Plot(50, 27, t$)
  2865.     CALL VerticalLine(24, 26, 32, t$)
  2866.     CALL VerticalLine(24, 26, 51, t$)
  2867.     RETURN
  2868.  
  2869.     endWormHoleSUB:
  2870.     PLAY returnBeep
  2871.     COLOR 0, 0
  2872.     CLS
  2873.     CALL PrintGrid
  2874.  
  2875. SUB DrawEspializer7 (direction$, centerX, centerY, eraseShip)
  2876.     SELECT CASE direction$
  2877.         CASE "N"
  2878.             IF eraseShip = FALSE THEN
  2879.                 COLOR 9, 0
  2880.             ELSE
  2881.                 COLOR 0, 0
  2882.             END IF
  2883.             CALL VerticalLine(centerY, centerY + 4, centerX - 3, t$)
  2884.             CALL VerticalLine(centerY, centerY + 4, centerX + 3, t$)
  2885.             IF eraseShip = FALSE THEN
  2886.                 COLOR 15, 0
  2887.             ELSE
  2888.                 COLOR 0, 0
  2889.             END IF
  2890.             CALL VerticalLine(centerY - 2, centerY, centerX - 2, t$)
  2891.             CALL VerticalLine(centerY - 2, centerY, centerX + 2, t$)
  2892.             CALL VerticalLine(centerY - 3, centerY - 1, centerX - 1, t$)
  2893.             CALL VerticalLine(centerY - 3, centerY - 1, centerX + 1, t$)
  2894.             CALL VerticalLine(centerY - 4, centerY - 1, centerX, t$)
  2895.         CASE "S"
  2896.             IF eraseShip = FALSE THEN
  2897.                 COLOR 9, 0
  2898.             ELSE
  2899.                 COLOR 0, 0
  2900.             END IF
  2901.             CALL VerticalLine(centerY - 4, centerY, centerX - 3, t$)
  2902.             CALL VerticalLine(centerY - 4, centerY, centerX + 3, t$)
  2903.             IF eraseShip = FALSE THEN
  2904.                 COLOR 15, 0
  2905.             ELSE
  2906.                 COLOR 0, 0
  2907.             END IF
  2908.             CALL VerticalLine(centerY, centerY + 2, centerX - 2, t$)
  2909.             CALL VerticalLine(centerY, centerY + 2, centerX + 2, t$)
  2910.             CALL VerticalLine(centerY + 1, centerY + 3, centerX - 1, t$)
  2911.             CALL VerticalLine(centerY + 1, centerY + 3, centerX + 1, t$)
  2912.             CALL VerticalLine(centerY + 1, centerY + 4, centerX, t$)
  2913.         CASE "E"
  2914.             IF eraseShip = FALSE THEN
  2915.                 COLOR 9, 0
  2916.             ELSE
  2917.                 COLOR 0, 0
  2918.             END IF
  2919.             CALL HorizontalLine(centerX - 4, centerX, centerY - 3, t$)
  2920.             CALL HorizontalLine(centerX - 4, centerX, centerY + 3, t$)
  2921.             IF eraseShip = FALSE THEN
  2922.                 COLOR 15, 0
  2923.             ELSE
  2924.                 COLOR 0, 0
  2925.             END IF
  2926.             CALL HorizontalLine(centerX, centerX + 2, centerY - 2, t$)
  2927.             CALL HorizontalLine(centerX, centerX + 2, centerY + 2, t$)
  2928.             CALL HorizontalLine(centerX + 1, centerX + 3, centerY - 1, t$)
  2929.             CALL HorizontalLine(centerX + 1, centerX + 3, centerY + 1, t$)
  2930.             CALL HorizontalLine(centerX + 1, centerX + 4, centerY, t$)
  2931.         CASE "W"
  2932.             IF eraseShip = FALSE THEN
  2933.                 COLOR 9, 0
  2934.             ELSE
  2935.                 COLOR 0, 0
  2936.             END IF
  2937.             CALL HorizontalLine(centerX, centerX + 4, centerY - 3, t$)
  2938.             CALL HorizontalLine(centerX, centerX + 4, centerY + 3, t$)
  2939.             IF eraseShip = FALSE THEN
  2940.                 COLOR 15, 0
  2941.             ELSE COLOR 0, 0
  2942.             END IF
  2943.             CALL HorizontalLine(centerX - 2, centerX, centerY - 2, t$)
  2944.             CALL HorizontalLine(centerX - 2, centerX, centerY + 2, t$)
  2945.             CALL HorizontalLine(centerX - 3, centerX - 1, centerY - 1, t$)
  2946.             CALL HorizontalLine(centerX - 3, centerX - 1, centerY + 1, t$)
  2947.             CALL HorizontalLine(centerX - 4, centerX - 1, centerY, t$)
  2948.     END SELECT
  2949.  
  2950. SUB HorizontalLine (starting, ending, vertical, character$)
  2951.     FOR drawing = starting TO ending
  2952.         LOCATE vertical, drawing
  2953.         PRINT character$
  2954.     NEXT drawing
  2955.  
  2956. SUB VerticalLine (starting, ending, horizontal, character$)
  2957.     FOR drawing = starting TO ending
  2958.         LOCATE drawing, horizontal
  2959.         PRINT character$
  2960.     NEXT drawing
  2961.  
  2962. SUB Plot (horizontal, vertical, character$)
  2963.     LOCATE vertical, horizontal
  2964.     PRINT character$
  2965.  
  2966. SUB PlayGalaxyGrid (loadYN$)
  2967.     gameInProgress = TRUE
  2968.     tabPushed = 0
  2969.     IF loadYN$ = "N" THEN
  2970.         CALL SetGameElements
  2971.     ELSE
  2972.         CALL PrintGrid
  2973.     END IF
  2974.     pauseExecution = TRUE
  2975.     DO
  2976.         pauseExecution = FALSE
  2977.         commandInput$ = INKEY$
  2978.         SELECT CASE commandInput$
  2979.             CASE CHR$(0) + "H" ' up
  2980.                 pauseExecution = TRUE
  2981.                 IF Espializer7.y > 1 THEN
  2982.                     COLOR 0, 0
  2983.                     LOCATE Espializer7.y, Espializer7.x
  2984.                     PRINT t$
  2985.                     Espializer7.y = Espializer7.y - 1
  2986.                     fleetJumpsWhenThisReaches0 = fleetJumpsWhenThisReaches0 - 1
  2987.                     PLAY lowBeep
  2988.                     tabPushed = 0
  2989.                     shipLog.moves = shipLog.moves + 1
  2990.                 END IF
  2991.             CASE CHR$(0) + "K" ' left
  2992.                 pauseExecution = TRUE
  2993.                 COLOR 0, 0
  2994.                 LOCATE Espializer7.y, Espializer7.x
  2995.                 PRINT t$
  2996.                 IF Espializer7.x > 1 THEN
  2997.                     Espializer7.x = Espializer7.x - 1
  2998.                     fleetJumpsWhenThisReaches0 = fleetJumpsWhenThisReaches0 - 1
  2999.                     PLAY lowBeep
  3000.                     tabPushed = 0
  3001.                     shipLog.moves = shipLog.moves + 1
  3002.                 END IF
  3003.             CASE CHR$(0) + "P" ' down
  3004.                 pauseExecution = TRUE
  3005.                 COLOR 0, 0
  3006.                 LOCATE Espializer7.y, Espializer7.x
  3007.                 PRINT t$
  3008.                 IF Espializer7.y < 45 THEN
  3009.                     Espializer7.y = Espializer7.y + 1
  3010.                     fleetJumpsWhenThisReaches0 = fleetJumpsWhenThisReaches0 - 1
  3011.                     PLAY lowBeep
  3012.                     tabPushed = 0
  3013.                     shipLog.moves = shipLog.moves + 1
  3014.                 END IF
  3015.             CASE CHR$(0) + "M" ' right
  3016.                 pauseExecution = TRUE
  3017.                 COLOR 0, 0
  3018.                 LOCATE Espializer7.y, Espializer7.x
  3019.                 PRINT t$
  3020.                 IF Espializer7.x < 80 THEN
  3021.                     Espializer7.x = Espializer7.x + 1
  3022.                     fleetJumpsWhenThisReaches0 = fleetJumpsWhenThisReaches0 - 1
  3023.                     PLAY lowBeep
  3024.                     tabPushed = 0
  3025.                     shipLog.moves = shipLog.moves + 1
  3026.                 END IF
  3027.             CASE CHR$(27) 'ESC
  3028.                 COLOR 14, 1
  3029.                 CLS
  3030.                 LOCATE 20, 20
  3031.                 PRINT "Are you sure you want to exit? ";
  3032.                 definite$ = UCASE$(INPUT$(1))
  3033.                 IF definite$ = "Y" OR definite$ = CHR$(27) THEN
  3034.                     PLAY errorBeep
  3035.                     END
  3036.                 ELSE
  3037.                     COLOR 15, 0
  3038.                     CLS
  3039.                     CALL PrintGrid
  3040.                 END IF
  3041.             CASE CHR$(9) 'TAB
  3042.                 tabPushed = 1
  3043.                 PLAY selectionBeep
  3044.                 SELECT CASE tabToggle
  3045.                     CASE 1
  3046.                         tabToggle = 2
  3047.                     CASE 2
  3048.                         tabToggle = 3
  3049.                     CASE 3
  3050.                         tabToggle = 1
  3051.                 END SELECT
  3052.                 CALL PrintGrid
  3053.             CASE " "
  3054.                 IF quizPassed = FALSE THEN CALL MultipleChoice
  3055.             CASE "S", "s"
  3056.                 CALL SaveGame
  3057.             CASE "M", "m"
  3058.                 CALL MainMenu
  3059.         END SELECT
  3060.         IF pauseExecution = TRUE AND tabPushed = 0 THEN
  3061.             IF fleetJumpsWhenThisReaches0 = 0 THEN
  3062.                 CALL MoveFleet
  3063.                 max = 40
  3064.                 min = 20
  3065.                 jump = INT(RND * (max - min + 1)) + min
  3066.                 fleetJumpsWhenThisReaches0 = jump
  3067.             END IF
  3068.             CALL PrintGrid
  3069.             SELECT CASE grid(Espializer7.x, Espializer7.y, 1)
  3070.                 CASE 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
  3071.                     COLOR 13, 0
  3072.                     CLS
  3073.                     CALL UseWormHole
  3074.                 CASE blackHole.code
  3075.                     COLOR 7, 0
  3076.                     CLS
  3077.                     CALL InsideBlackHole
  3078.                 CASE wifranColony.code
  3079.                     CALL AtWifranColony
  3080.                 CASE otherPlanet.code
  3081.                     CALL VisitPlanet
  3082.                 CASE sarienShip.code
  3083.                     IF grid(Espializer7.x, Espializer7.y, 3) <> 0 THEN CALL Battle(0)
  3084.                 CASE disabledShip.code
  3085.                     IF grid(Espializer7.x, Espializer7.y, 3) <> 0 THEN CALL AidDisabledShip
  3086.                 CASE Top.code, Bottom.code
  3087.                     CALL SpaceStation
  3088.                 CASE informant.code
  3089.                     IF grid(Espializer7.x, Espializer7.y, 3) <> 0 THEN CALL DockForInfo
  3090.                 CASE sarienFleet.code
  3091.                     CALL BattleFleet
  3092.             END SELECT
  3093.         END IF
  3094.         LOCATE
  3095.     LOOP
  3096.  
  3097. SUB MoveFleet
  3098.     'find the top left coordinate
  3099.     x = 0
  3100.     y = 0
  3101.     FOR locateFleetX = 1 TO 79
  3102.         FOR locateFleetY = 1 TO 44
  3103.             IF grid(locateFleetX, locateFleetY, 1) = sarienFleet.code THEN
  3104.                 x = locateFleetX
  3105.                 y = locateFleetY
  3106.                 EXIT FOR
  3107.             END IF
  3108.         NEXT locateFleetY
  3109.         IF x <> 0 AND y <> 0 THEN EXIT FOR
  3110.     NEXT locateFleetX
  3111.  
  3112.     willNotFit:
  3113.     'find a new place for the fleet
  3114.     xTry = RNX
  3115.     IF xTry >= 80 THEN xTry = xTry - 1
  3116.     yTry = RNY
  3117.     IF yTry >= 45 THEN yTry = yTry - 1
  3118.     IF grid(xTry, yTry, 1) = 0 AND grid(xTry + 1, yTry, 1) = 0 AND grid(xTry, yTry + 1, 1) = 0 AND grid(xTry + 1, yTry + 1, 1) = 0 THEN
  3119.         'reposition the fleet
  3120.         grid(xTry, yTry, 1) = sarienFleet.code
  3121.         grid(xTry, yTry, 2) = sarienFleet.clr
  3122.         grid(xTry, yTry, 3) = grid(x, y, 3)
  3123.         grid(xTry + 1, yTry, 1) = sarienFleet.code
  3124.         grid(xTry + 1, yTry, 2) = sarienFleet.clr
  3125.         grid(xTry + 1, yTry, 3) = grid(x + 1, y, 3)
  3126.         grid(xTry, yTry + 1, 1) = sarienFleet.code
  3127.         grid(xTry, yTry + 1, 2) = sarienFleet.clr
  3128.         grid(xTry, yTry + 1, 3) = grid(x, y + 1, 3)
  3129.         grid(xTry + 1, yTry + 1, 1) = sarienFleet.code
  3130.         grid(xTry + 1, yTry + 1, 2) = sarienFleet.clr
  3131.         grid(xTry + 1, yTry + 1, 3) = grid(x + 1, y + 1, 3)
  3132.         'deduct a point or two so the fewer moves the slightly higher score
  3133.         shipLog.score = shipLog.score - 1
  3134.         'remove the previous fleet location from the grid
  3135.         grid(x, y, 1) = 0
  3136.         grid(x, y, 2) = 0
  3137.         grid(x, y, 3) = 0
  3138.         grid(x + 1, y, 1) = 0
  3139.         grid(x + 1, y, 2) = 0
  3140.         grid(x + 1, y, 3) = 0
  3141.         grid(x, y + 1, 1) = 0
  3142.         grid(x, y + 1, 2) = 0
  3143.         grid(x, y + 1, 3) = 0
  3144.         grid(x + 1, y + 1, 1) = 0
  3145.         grid(x + 1, y + 1, 2) = 0
  3146.         grid(x + 1, y + 1, 3) = 0
  3147.     ELSE
  3148.         GOTO willNotFit
  3149.     END IF
  3150.     COLOR 15, 0
  3151.     CLS
  3152.     CALL PrintGrid
  3153.  
  3154. SUB AtWifranColony
  3155.     COLOR 15, 0
  3156.     CLS
  3157.     'Draw the ocean part of the planet
  3158.     COLOR 1
  3159.     CALL HorizontalLine(1, 32, 45, CHR$(219))
  3160.     CALL HorizontalLine(2, 32, 44, CHR$(219))
  3161.     CALL HorizontalLine(3, 33, 43, CHR$(219))
  3162.     CALL HorizontalLine(4, 33, 42, CHR$(219))
  3163.     CALL HorizontalLine(6, 34, 41, CHR$(219))
  3164.     CALL HorizontalLine(7, 34, 40, CHR$(219))
  3165.     CALL HorizontalLine(8, 35, 39, CHR$(219))
  3166.     CALL HorizontalLine(10, 36, 38, CHR$(219))
  3167.     CALL HorizontalLine(12, 37, 37, CHR$(219))
  3168.     CALL HorizontalLine(13, 39, 36, CHR$(219))
  3169.     CALL HorizontalLine(68, 69, 36, CHR$(219))
  3170.     CALL HorizontalLine(15, 41, 35, CHR$(219))
  3171.     CALL HorizontalLine(53, 69, 35, CHR$(219))
  3172.     CALL HorizontalLine(16, 45, 34, CHR$(219))
  3173.     CALL HorizontalLine(50, 68, 34, CHR$(219))
  3174.     CALL HorizontalLine(18, 67, 33, CHR$(219))
  3175.     CALL HorizontalLine(20, 65, 32, CHR$(219))
  3176.     CALL HorizontalLine(22, 64, 31, CHR$(219))
  3177.     CALL HorizontalLine(24, 62, 30, CHR$(219))
  3178.     CALL HorizontalLine(26, 60, 29, CHR$(219))
  3179.     CALL HorizontalLine(28, 58, 28, CHR$(219))
  3180.     CALL HorizontalLine(31, 56, 27, CHR$(219))
  3181.     CALL HorizontalLine(35, 53, 26, CHR$(219))
  3182.     CALL HorizontalLine(40, 50, 25, CHR$(219))
  3183.  
  3184.     'Draw the forest part of the planet
  3185.     COLOR 2
  3186.     CALL HorizontalLine(33, 52, 45, CHR$(219))
  3187.     CALL HorizontalLine(33, 53, 44, CHR$(219))
  3188.     CALL HorizontalLine(34, 54, 43, CHR$(219))
  3189.     CALL HorizontalLine(34, 55, 42, CHR$(219))
  3190.     CALL HorizontalLine(35, 56, 41, CHR$(219))
  3191.     CALL HorizontalLine(35, 57, 40, CHR$(219))
  3192.     CALL HorizontalLine(36, 65, 39, CHR$(219))
  3193.     CALL HorizontalLine(37, 67, 38, CHR$(219))
  3194.     CALL HorizontalLine(38, 70, 37, CHR$(219))
  3195.     CALL HorizontalLine(40, 67, 36, CHR$(219))
  3196.     CALL HorizontalLine(42, 52, 35, CHR$(219))
  3197.     CALL HorizontalLine(46, 49, 34, CHR$(219))
  3198.     CALL Plot(70, 36, CHR$(219))
  3199.  
  3200.     'Draw the dirt/other colored land part of the planet
  3201.     COLOR 6
  3202.     CALL HorizontalLine(53, 80, 45, CHR$(219))
  3203.     CALL HorizontalLine(54, 79, 44, CHR$(219))
  3204.     CALL HorizontalLine(55, 78, 43, CHR$(219))
  3205.     CALL HorizontalLine(56, 77, 42, CHR$(219))
  3206.     CALL HorizontalLine(57, 76, 41, CHR$(219))
  3207.     CALL HorizontalLine(58, 75, 40, CHR$(219))
  3208.     CALL HorizontalLine(66, 74, 39, CHR$(219))
  3209.     CALL HorizontalLine(68, 73, 38, CHR$(219))
  3210.     CALL HorizontalLine(71, 72, 37, CHR$(219))
  3211.     CALL Plot(71, 36, CHR$(219))
  3212.     'Draw the Espializer7 in the upper left portion of the screen
  3213.     CALL DrawEspializer7("E", 5, 6, 0)
  3214.     'Display message
  3215.     COLOR 15, 0
  3216.     a$ = "The Espializer 7 is near a Wifran colony."
  3217.     LOCATE 5, GetCenter(a$)
  3218.     PRINT a$
  3219.     LOCATE 9, GetCenter("push tspacebarj to take up orbit")
  3220.     COLOR 10, 0
  3221.     PRINT "Push ";
  3222.     COLOR 14, 0
  3223.     PRINT "[SPACEBAR]";
  3224.     COLOR 10, 0
  3225.     PRINT " to take up orbit."
  3226.     CALL WaitForCharacter(CHR$(32))
  3227.     'Move the Espializer7 to transporter range
  3228.     FOR x = 5 TO 70 '5 to 70
  3229.         CALL DrawEspializer7("E", x, 6, 0)
  3230.         _DELAY movingShipDelay
  3231.         IF x >= 19 AND x <= 59 THEN
  3232.             IF x MOD 3 = 0 THEN PLAY runOverText$
  3233.         ELSE
  3234.             IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  3235.         END IF
  3236.         CALL DrawEspializer7("E", x, 6, 1)
  3237.     NEXT x
  3238.     'reprint the Espializer7 to prepare for transport
  3239.     CALL DrawEspializer7("S", 75, 5, 0)
  3240.     a$ = "Push [esc] to hail the colony."
  3241.     LOCATE 8, GetCenter(a$)
  3242.     COLOR 10, 0
  3243.     PRINT "Push ";
  3244.     COLOR 14, 0
  3245.     PRINT "[ESC]";
  3246.     COLOR 10, 0
  3247.     PRINT " to hail the colony."
  3248.     CALL WaitForCharacter(CHR$(27))
  3249.     LOCATE 8
  3250.     PRINT STRING$(70, " ")
  3251.     PLAY hail
  3252.     _DELAY hailDelay
  3253.     ClearStatus
  3254.     LOCATE 3, 2
  3255.     COLOR 15, 0
  3256.     PRINT " You have ";
  3257.     COLOR esplzr.clr, 0
  3258.     PRINT LTRIM$(STR$(shipLog.currentSurvivors));
  3259.     COLOR 15, 0
  3260.     PRINT " survivor";
  3261.     IF shipLog.currentSurvivors <> 1 THEN PRINT "s";
  3262.     PRINT " on board. "
  3263.     availableHomes = grid(Espializer7.x, Espializer7.y, 3)
  3264.     IF availableHomes = -1 THEN availableHomes = 0
  3265.     pplAboard = shipLog.currentSurvivors
  3266.     IF pplAboard = 0 THEN
  3267.         PLAY errorBeep
  3268.         shipLog.morale = shipLog.morale - 10
  3269.         shipLog.score = shipLog.score - 30
  3270.         shipLog.totalMorale = shipLog.totalMorale - 10
  3271.         ClearStatus
  3272.         COLOR 15, 0
  3273.         a$ = "The colonists are irritated that you disturbed them."
  3274.         LOCATE 7, 4
  3275.         PRINT a$
  3276.         COLOR 12, 0
  3277.         a$ = "You have no survivors on board."
  3278.         b$ = "Penalty of -10 morale and -30 score applied."
  3279.         LOCATE 16, GetCenter(a$)
  3280.         PRINT a$
  3281.         COLOR 28, 0
  3282.         LOCATE 18, GetCenter(b$)
  3283.         PRINT b$
  3284.         LOCATE 8
  3285.         PRINT STRING$(70, " ")
  3286.         LOCATE 23, GetCenter("Push -x- to return to the galaxy grid.")
  3287.         COLOR 10, 0
  3288.         PRINT "Push " + CHR$(34);
  3289.         COLOR 14, 0
  3290.         PRINT "R";
  3291.         COLOR 10, 0
  3292.         PRINT CHR$(34) + " to ";
  3293.         COLOR 14, 0
  3294.         PRINT "r";
  3295.         COLOR 10, 0
  3296.         PRINT "eturn to the Galaxy Grid."
  3297.         CALL WaitForCharacter("r")
  3298.         PLAY returnBeep$
  3299.         GOTO EndOfSub
  3300.     ELSE
  3301.         IF availableHomes >= pplAboard THEN
  3302.             ppltoBeam = pplAboard
  3303.         ELSE
  3304.             ppltoBeam = availableHomes
  3305.         END IF
  3306.         IF availableHomes <> 0 THEN
  3307.             a$ = "The colonists say they can accomodate # survivor"
  3308.             ap = GetCenter(a$ + ".")
  3309.             COLOR 15, 0
  3310.             LOCATE 6, ap
  3311.             IF availableHomes <> 1 THEN
  3312.                 a$ = a$ + "s."
  3313.             ELSE
  3314.                 a$ = a$ + "."
  3315.             END IF
  3316.             PRINT USING a$; availableHomes
  3317.         ELSE
  3318.             ClearStatus
  3319.             a$ = "These colonists cannot assist you at this time."
  3320.             LOCATE 6, GetCenter(a$)
  3321.             COLOR 15, 0
  3322.             PRINT a$
  3323.             LOCATE 10, GetCenter("Push 'r' to return to the grid.")
  3324.             COLOR 10, 0
  3325.             PRINT "Push " + CHR$(34);
  3326.             COLOR 14, 0
  3327.             PRINT "R";
  3328.             COLOR 10, 0
  3329.             PRINT CHR$(34) + " to ";
  3330.             COLOR 14, 0
  3331.             PRINT "r";
  3332.             COLOR 10, 0
  3333.             PRINT "eturn to the Galaxy Grid."
  3334.             CALL WaitForCharacter("r")
  3335.             PLAY returnBeep
  3336.             GOTO EndOfSub
  3337.         END IF
  3338.     END IF
  3339.     grid(Espializer7.x, Espializer7.y, 3) = grid(Espializer7.x, Espializer7.y, 3) - ppltoBeam
  3340.     IF grid(Espializer7.x, Espializer7.y, 3) = 0 THEN grid(Espializer7.x, Espializer7.y, 3) = -1
  3341.     shipLog.totalSurvivorsSaved = shipLog.totalSurvivorsSaved + ppltoBeam
  3342.     shipLog.morale = shipLog.morale + (ppltoBeam * 30)
  3343.     shipLog.totalMorale = shipLog.totalMorale + shipLog.morale
  3344.     shipLog.score = shipLog.score + (ppltoBeam * 30)
  3345.     a$ = "push -b- to beam survivor ## to the surface."
  3346.     ap = GetCenter(a$)
  3347.     FOR people = 1 TO ppltoBeam
  3348.         LOCATE 15, ap
  3349.         COLOR 10, 0
  3350.         PRINT "Push " + CHR$(34);
  3351.         COLOR 14, 0
  3352.         PRINT "B";
  3353.         COLOR 10, 0
  3354.         PRINT CHR$(34) + " to ";
  3355.         COLOR 14, 0
  3356.         PRINT "b";
  3357.         COLOR 10, 0
  3358.         PRINT "eam survivor #";
  3359.         COLOR esplzr.clr, 0
  3360.         PRINT LTRIM$(STR$(people));
  3361.         COLOR 10, 0
  3362.         PRINT " to the surface.   "
  3363.         CALL WaitForCharacter("b")
  3364.         PLAY beamingBeep
  3365.         shipLog.currentSurvivors = shipLog.currentSurvivors - 1
  3366.         availableHomes = availableHomes - 1
  3367.         LOCATE 3, 3
  3368.         COLOR 15, 0
  3369.         PRINT "You have ";
  3370.         COLOR esplzr.clr, 0
  3371.         PRINT LTRIM$(STR$(shipLog.currentSurvivors));
  3372.         COLOR 15, 0
  3373.         PRINT " survivor";
  3374.         IF shipLog.currentSurvivors <> 1 THEN PRINT "s";
  3375.         PRINT " on board. "
  3376.         a$ = "The colonists say they can accomodate # survivor"
  3377.         ap = GetCenter(a$ + ".")
  3378.         COLOR 15, 0
  3379.         LOCATE 6, ap
  3380.         IF availableHomes <> 1 THEN
  3381.             a$ = a$ + "s."
  3382.         ELSE
  3383.             a$ = a$ + ". "
  3384.         END IF
  3385.         PRINT USING a$; availableHomes
  3386.         FOR y = 10 TO 30
  3387.             COLOR 7, 0
  3388.             CALL Plot(75, y, CHR$(2))
  3389.             CALL Plot(72, y + 2, CHR$(219))
  3390.             CALL Plot(78, y + 2, CHR$(219))
  3391.             COLOR 12
  3392.             CALL HorizontalLine(74, 76, y + 1, CHR$(219))
  3393.             CALL HorizontalLine(73, 77, y + 2, CHR$(219))
  3394.             CALL HorizontalLine(74, 76, y + 3, CHR$(219))
  3395.             CALL HorizontalLine(74, 76, y + 4, CHR$(219))
  3396.             CALL HorizontalLine(74, 76, y + 5, CHR$(219))
  3397.             CALL Plot(76, y + 6, CHR$(219))
  3398.             CALL Plot(74, y + 6, CHR$(219))
  3399.             COLOR 15
  3400.             CALL HorizontalLine(73, 74, y + 7, CHR$(219))
  3401.             CALL HorizontalLine(76, 77, y + 7, CHR$(219))
  3402.             _DELAY (movingShipDelay)
  3403.             COLOR 0, 0
  3404.             CALL Plot(75, y, CHR$(219))
  3405.             CALL Plot(72, y + 2, CHR$(219))
  3406.             CALL Plot(78, y + 2, CHR$(219))
  3407.             CALL HorizontalLine(74, 76, y + 1, CHR$(219))
  3408.             CALL HorizontalLine(73, 77, y + 2, CHR$(219))
  3409.             CALL HorizontalLine(74, 76, y + 3, CHR$(219))
  3410.             CALL HorizontalLine(74, 76, y + 4, CHR$(219))
  3411.             CALL HorizontalLine(74, 76, y + 5, CHR$(219))
  3412.             CALL Plot(74, y + 6, CHR$(219))
  3413.             CALL Plot(76, y + 6, CHR$(219))
  3414.             CALL HorizontalLine(73, 74, y + 7, CHR$(219))
  3415.             CALL HorizontalLine(76, 77, y + 7, CHR$(219))
  3416.         NEXT y
  3417.     NEXT people
  3418.     ClearStatus
  3419.     LOCATE 48, GetCenter("Push 'r' to return to the grid.")
  3420.     COLOR 10, 0
  3421.     PRINT "Push " + CHR$(34);
  3422.     COLOR 14, 0
  3423.     PRINT "R";
  3424.     COLOR 10, 0
  3425.     PRINT CHR$(34) + " to ";
  3426.     COLOR 14, 0
  3427.     PRINT "r";
  3428.     COLOR 10, 0
  3429.     PRINT "eturn to the Galaxy Grid."
  3430.     CALL WaitForCharacter("r")
  3431.     PLAY returnBeep
  3432.     EndOfSub:
  3433.     COLOR 0, 0
  3434.     LOCATE 46
  3435.     PRINT STRING$(75, CHR$(32))
  3436.     PRINT STRING$(75, CHR$(32))
  3437.     PRINT STRING$(75, CHR$(32))
  3438.     CLS
  3439.     CALL PrintGrid
  3440.  
  3441. SUB Boom ()
  3442.     CLS
  3443.     a$ = message$
  3444.     IF message$ <> "" THEN
  3445.         ab = GetCenter(a$)
  3446.         LOCATE 20, ab
  3447.         PRINT a$
  3448.         _DELAY (3.5)
  3449.         LOCATE 20, ab
  3450.         PRINT STRING$(LEN(a$), " ")
  3451.     END IF
  3452.     'Espializer 7 in the center of the screen
  3453.     useDelay = 0.5
  3454.     c$ = t$
  3455.     COLOR 9, 0
  3456.     CALL VerticalLine(26, 30, 37, t$)
  3457.     CALL VerticalLine(26, 30, 43, t$)
  3458.     COLOR 15
  3459.     CALL VerticalLine(22, 25, 40, t$)
  3460.     CALL VerticalLine(23, 25, 41, t$)
  3461.     CALL VerticalLine(23, 25, 39, t$)
  3462.     CALL VerticalLine(24, 26, 38, t$)
  3463.     CALL VerticalLine(24, 26, 42, t$)
  3464.     _DELAY (0.5)
  3465.     GOTO BoomDenouement
  3466.  
  3467.     'circle to blot out the ship. first of the concussive blasts
  3468.     circlesDelay = 0.1
  3469.     FirstCircle: 'innermost to outer
  3470.     COLOR 4
  3471.     CALL HorizontalLine(39, 41, 18, t$)
  3472.     CALL HorizontalLine(36, 44, 19, t$)
  3473.     CALL HorizontalLine(35, 45, 20, t$)
  3474.     CALL HorizontalLine(34, 46, 21, t$)
  3475.     CALL HorizontalLine(34, 46, 22, t$)
  3476.     CALL HorizontalLine(33, 47, 23, t$)
  3477.     CALL HorizontalLine(33, 47, 24, t$)
  3478.     CALL HorizontalLine(33, 47, 25, t$)
  3479.     CALL HorizontalLine(33, 47, 26, t$)
  3480.     CALL HorizontalLine(33, 47, 27, t$)
  3481.     CALL HorizontalLine(34, 46, 28, t$)
  3482.     CALL HorizontalLine(35, 45, 29, t$)
  3483.     CALL HorizontalLine(36, 44, 30, t$)
  3484.     CALL HorizontalLine(37, 43, 31, t$)
  3485.     CALL HorizontalLine(39, 41, 32, t$)
  3486.     _DELAY (circlesDelay)
  3487.     RETURN
  3488.  
  3489.     SecondCircle:
  3490.     CALL HorizontalLine(38, 42, 11, t$)
  3491.     CALL HorizontalLine(35, 45, 12, t$)
  3492.     CALL HorizontalLine(33, 47, 13, t$)
  3493.     CALL HorizontalLine(32, 48, 14, t$)
  3494.     CALL HorizontalLine(31, 49, 15, t$)
  3495.     CALL HorizontalLine(30, 50, 16, t$)
  3496.     CALL HorizontalLine(29, 51, 17, t$)
  3497.     CALL HorizontalLine(28, 52, 18, t$)
  3498.     CALL HorizontalLine(28, 52, 19, t$)
  3499.     CALL HorizontalLine(27, 53, 20, t$)
  3500.     CALL HorizontalLine(27, 53, 21, t$)
  3501.     hLeft = 26
  3502.     hRight = 53
  3503.     FOR yPos = 22 TO 28
  3504.         CALL HorizontalLine(hLeft, hRight, yPos, t$)
  3505.     NEXT yPos
  3506.     CALL HorizontalLine(27, 52, 29, t$)
  3507.     CALL HorizontalLine(27, 52, 30, t$)
  3508.     CALL HorizontalLine(28, 51, 31, t$)
  3509.     CALL HorizontalLine(28, 51, 32, t$)
  3510.     CALL HorizontalLine(29, 50, 33, t$)
  3511.     CALL HorizontalLine(30, 49, 34, t$)
  3512.     CALL HorizontalLine(30, 49, 35, t$)
  3513.     CALL HorizontalLine(31, 48, 36, t$)
  3514.     CALL HorizontalLine(32, 48, 37, t$)
  3515.     CALL HorizontalLine(34, 46, 38, t$)
  3516.     CALL HorizontalLine(47, 43, 39, t$)
  3517.     RETURN
  3518.  
  3519.     ThirdCircle:
  3520.     CALL HorizontalLine(38, 43, 4, t$)
  3521.     CALL HorizontalLine(34, 48, 5, t$)
  3522.     CALL HorizontalLine(31, 50, 6, t$)
  3523.     CALL HorizontalLine(30, 51, 7, t$)
  3524.     h1 = 28
  3525.     h2 = 53
  3526.     FOR vPos = 8 TO 13
  3527.         CALL HorizontalLine(h1, h2, vPos, t$)
  3528.         h1 = h1 - 1
  3529.         h2 = h2 + 1
  3530.     NEXT vPos
  3531.     CALL HorizontalLine(23, 58, 14, t$)
  3532.     CALL HorizontalLine(22, 59, 15, t$)
  3533.     CALL HorizontalLine(22, 59, 16, t$)
  3534.     FOR vPos = 17 TO 21
  3535.         CALL HorizontalLine(21, 60, vPos, t$)
  3536.         CALL HorizontalLine(21, 60, vPos + 12, t$)
  3537.     NEXT vPos
  3538.     FOR vPos = 22 TO 28
  3539.         CALL HorizontalLine(20, 61, vPos, t$)
  3540.     NEXT vPos
  3541.     FOR vPos = 29 TO 33
  3542.         CALL HorizontalLine(21, 60, vPos, t$)
  3543.     NEXT vPos
  3544.     CALL HorizontalLine(22, 59, 34, t$)
  3545.     CALL HorizontalLine(22, 59, 35, t$)
  3546.     CALL HorizontalLine(23, 58, 36, t$)
  3547.     h1 = 23
  3548.     h2 = 58
  3549.     FOR vPos = 37 TO 42
  3550.         CALL HorizontalLine(h1, h2, vPos, t$)
  3551.         h1 = h1 + 1
  3552.         h2 = h2 - 1
  3553.     NEXT vPos
  3554.     CALL HorizontalLine(30, 51, 43, t$)
  3555.     CALL HorizontalLine(31, 50, 44, t$)
  3556.     CALL HorizontalLine(34, 48, 45, t$)
  3557.     '    CALL HorizontalLine(38, 43, 47, t$)
  3558.     RETURN
  3559.  
  3560.     FourthCircle:
  3561.     CALL HorizontalLine(33, 46, 2, t$)
  3562.     CALL HorizontalLine(30, 51, 3, t$)
  3563.     CALL HorizontalLine(29, 53, 4, t$)
  3564.     CALL HorizontalLine(28, 54, 5, t$)
  3565.     CALL HorizontalLine(26, 56, 6, t$)
  3566.     CALL HorizontalLine(25, 57, 7, t$)
  3567.     CALL HorizontalLine(24, 58, 8, t$)
  3568.     CALL HorizontalLine(22, 60, 9, t$)
  3569.     CALL HorizontalLine(22, 60, 10, t$)
  3570.     CALL HorizontalLine(21, 61, 11, t$)
  3571.     CALL HorizontalLine(20, 62, 12, t$)
  3572.     CALL HorizontalLine(19, 63, 13, t$)
  3573.     CALL HorizontalLine(19, 63, 14, t$)
  3574.     CALL HorizontalLine(18, 64, 15, t$)
  3575.     CALL HorizontalLine(18, 64, 16, t$)
  3576.     CALL HorizontalLine(17, 65, 17, t$)
  3577.     CALL HorizontalLine(17, 65, 18, t$)
  3578.     CALL HorizontalLine(17, 65, 19, t$)
  3579.     FOR vPos = 20 TO 29
  3580.         CALL HorizontalLine(16, 66, vPos, t$)
  3581.     NEXT vPos
  3582.     CALL HorizontalLine(17, 65, 30, t$)
  3583.     CALL HorizontalLine(17, 65, 31, t$)
  3584.     CALL HorizontalLine(17, 65, 32, t$)
  3585.     CALL HorizontalLine(18, 64, 33, t$)
  3586.     CALL HorizontalLine(18, 64, 34, t$)
  3587.     CALL HorizontalLine(19, 63, 35, t$)
  3588.     CALL HorizontalLine(19, 63, 36, t$)
  3589.     CALL HorizontalLine(20, 62, 37, t$)
  3590.     CALL HorizontalLine(21, 61, 38, t$)
  3591.     CALL HorizontalLine(22, 60, 39, t$)
  3592.     CALL HorizontalLine(22, 60, 40, t$)
  3593.     CALL HorizontalLine(24, 58, 41, t$)
  3594.     CALL HorizontalLine(25, 57, 42, t$)
  3595.     CALL HorizontalLine(26, 56, 43, t$)
  3596.     CALL HorizontalLine(28, 54, 44, t$)
  3597.     CALL HorizontalLine(29, 53, 45, t$)
  3598.     CALL HorizontalLine(30, 52, 46, t$)
  3599.     CALL HorizontalLine(33, 49, 47, t$)
  3600.  
  3601.     RETURN
  3602.  
  3603.     Flash:
  3604.     'Flash -- Old PC wouln't run this loop among other parts of this code. Needed a new gaming PC anyway
  3605.     useDelay = 0.1
  3606.     COLOR 0, 0
  3607.     CLS
  3608.     _DELAY (useDelay)
  3609.     COLOR 15, 15
  3610.     CLS
  3611.     _DELAY (useDelay)
  3612.     COLOR 0, 0
  3613.     CLS
  3614.     _DELAY (useDelay)
  3615.     COLOR 15, 15
  3616.     CLS
  3617.     _DELAY (useDelay)
  3618.     COLOR 0, 0
  3619.     CLS
  3620.     _DELAY (useDelay)
  3621.     COLOR 15, 15
  3622.     CLS
  3623.     _DELAY (useDelay)
  3624.     COLOR 0, 0
  3625.     CLS
  3626.     _DELAY (useDelay)
  3627.     COLOR 15, 15
  3628.     CLS
  3629.     _DELAY (useDelay)
  3630.     COLOR 0, 0
  3631.     CLS
  3632.     _DELAY (useDelay)
  3633.     COLOR 15, 15
  3634.     CLS
  3635.     _DELAY (useDelay)
  3636.     COLOR 0, 0
  3637.     CLS
  3638.     _DELAY (useDelay)
  3639.     COLOR 15, 15
  3640.     CLS
  3641.     _DELAY (useDelay)
  3642.     COLOR 0, 0
  3643.     CLS
  3644.     _DELAY (useDelay)
  3645.     COLOR 15, 15
  3646.     CLS
  3647.     _DELAY (useDelay)
  3648.     COLOR 0, 0
  3649.     CLS
  3650.     _DELAY (useDelay)
  3651.     COLOR 15, 15
  3652.     CLS
  3653.     _DELAY (useDelay)
  3654.     COLOR 0, 0
  3655.     CLS
  3656.     _DELAY (useDelay)
  3657.     COLOR 15, 15
  3658.     CLS
  3659.     _DELAY (useDelay)
  3660.     COLOR 0, 0
  3661.     CLS
  3662.     _DELAY (useDelay)
  3663.     COLOR 15, 15
  3664.     CLS
  3665.     _DELAY (useDelay)
  3666.     COLOR 0, 0
  3667.     CLS
  3668.     _DELAY (useDelay)
  3669.     COLOR 15, 15
  3670.     CLS
  3671.     _DELAY (useDelay)
  3672.     COLOR 0, 0
  3673.     CLS
  3674.     _DELAY (useDelay)
  3675.     COLOR 15, 15
  3676.     CLS
  3677.     _DELAY (useDelay)
  3678.     COLOR 0, 0
  3679.     CLS
  3680.     _DELAY (useDelay)
  3681.     COLOR 15, 15
  3682.     CLS
  3683.     _DELAY (useDelay)
  3684.     COLOR 0, 0
  3685.     CLS
  3686.     RETURN
  3687.  
  3688.     'B
  3689.     B:
  3690.     COLOR 4, 0
  3691.     Bdelay = 0.025
  3692.     Bdelay1 = 0.01
  3693.     FOR vPos = 47 TO 3 STEP -1
  3694.         CALL Plot(18, vPos, t$) '1
  3695.         _DELAY (Bdelay1)
  3696.     NEXT vPos
  3697.     FOR hPos = 19 TO 31
  3698.         CALL Plot(hPos, 3, t$) '2
  3699.         _DELAY (Bdelay1)
  3700.     NEXT hPos
  3701.     CALL HorizontalLine(32, 34, 4, t$) '3
  3702.     _DELAY (Bdelay)
  3703.     CALL HorizontalLine(35, 36, 5, t$) '4
  3704.     _DELAY (Bdelay)
  3705.     CALL Plot(37, 6, t$) '5
  3706.     _DELAY (Bdelay)
  3707.     CALL Plot(38, 7, t$) '6
  3708.     _DELAY (Bdelay)
  3709.     CALL VerticalLine(8, 9, 39, t$) '7
  3710.     _DELAY (Bdelay)
  3711.     CALL VerticalLine(10, 12, 40, t$) '8
  3712.     _DELAY (Bdelay)
  3713.     CALL VerticalLine(13, 15, 41, t$) '9
  3714.     _DELAY (Bdelay)
  3715.     CALL VerticalLine(16, 18, 40, t$) '10
  3716.     _DELAY (Bdelay)
  3717.     CALL VerticalLine(19, 20, 39, t$) '11
  3718.     _DELAY (Bdelay)
  3719.     CALL Plot(38, 21, t$) '12
  3720.     _DELAY (Bdelay)
  3721.     CALL Plot(37, 22, t$) '13
  3722.     _DELAY (Bdelay)
  3723.     CALL HorizontalLine(35, 36, 23, t$) '14
  3724.     _DELAY (Bdelay)
  3725.     CALL HorizontalLine(32, 34, 24, t$) '15
  3726.     _DELAY (Bdelay)
  3727.     FOR hPos = 31 TO 18 STEP -1
  3728.         CALL Plot(hPos, 25, t$)
  3729.         _DELAY (Bdelay1)
  3730.     NEXT hPos
  3731.     COLOR 0, 0
  3732.     CALL HorizontalLine(19, 31, 25, t$) '16
  3733.     COLOR 4, 0
  3734.     FOR hPos = 18 TO 31
  3735.         CALL Plot(hPos, 25, t$)
  3736.         _DELAY (Bdelay1)
  3737.     NEXT hPos
  3738.     CALL HorizontalLine(32, 34, 26, t$) '17
  3739.     _DELAY (Bdelay)
  3740.     CALL HorizontalLine(35, 36, 27, t$) '18
  3741.     _DELAY (Bdelay)
  3742.     CALL Plot(37, 28, t$) '19
  3743.     _DELAY (Bdelay)
  3744.     CALL Plot(38, 29, t$) '20
  3745.     _DELAY (Bdelay)
  3746.     CALL VerticalLine(30, 31, 39, t$) '21
  3747.     _DELAY (Bdelay)
  3748.     CALL VerticalLine(32, 34, 40, t$) '22
  3749.     _DELAY (Bdelay)
  3750.     CALL VerticalLine(35, 37, 41, t$) '23
  3751.     _DELAY (Bdelay)
  3752.     CALL VerticalLine(38, 40, 40, t$) '24
  3753.     _DELAY (Bdelay)
  3754.     CALL VerticalLine(41, 42, 39, t$) '25
  3755.     _DELAY (Bdelay)
  3756.     CALL Plot(38, 43, t$) '26
  3757.     _DELAY (Bdelay)
  3758.     CALL Plot(37, 44, t$) '27
  3759.     _DELAY (Bdelay)
  3760.     CALL HorizontalLine(35, 36, 45, t$) '28
  3761.     _DELAY (Bdelay)
  3762.     CALL HorizontalLine(32, 34, 46, t$) '29
  3763.     _DELAY (Bdelay)
  3764.     FOR hPos = 31 TO 18 STEP -1
  3765.         CALL Plot(hPos, 47, t$) '30
  3766.         _DELAY (Bdelay1)
  3767.     NEXT hPos
  3768.     _DELAY (1)
  3769.     COLOR 0, 0
  3770.     CLS
  3771.     RETURN
  3772.  
  3773.     O:
  3774.     Odelay = 0.025
  3775.     COLOR 4, 0
  3776.     CALL HorizontalLine(37, 43, 3, t$) '1
  3777.     _DELAY (Odelay)
  3778.     CALL HorizontalLine(34, 36, 4, t$) '2
  3779.     _DELAY (Odelay)
  3780.     CALL HorizontalLine(31, 33, 5, t$) '3
  3781.     _DELAY (Odelay)
  3782.     CALL HorizontalLine(29, 30, 6, t$) '4
  3783.     _DELAY (Odelay)
  3784.     CALL HorizontalLine(27, 28, 7, t$) '5
  3785.     _DELAY (Odelay)
  3786.     CALL Plot(26, 8, t$) '6
  3787.     _DELAY (Odelay)
  3788.     CALL Plot(25, 9, t$) '7
  3789.     _DELAY (Odelay)
  3790.     CALL VerticalLine(10, 11, 24, t$) '8
  3791.     _DELAY (Odelay)
  3792.     CALL Plot(23, 12, t$) '9
  3793.     _DELAY (Odelay)
  3794.     CALL VerticalLine(13, 14, 22, t$) '10
  3795.     _DELAY (Odelay)
  3796.     CALL VerticalLine(15, 16, 21, t$) '11
  3797.     _DELAY (Odelay)
  3798.     CALL VerticalLine(17, 18, 20, t$) '12
  3799.     _DELAY (Odelay)
  3800.     CALL VerticalLine(19, 22, 19, t$) '13
  3801.     _DELAY (Odelay)
  3802.     CALL VerticalLine(23, 27, 18, t$) '14
  3803.     _DELAY (Odelay)
  3804.     CALL VerticalLine(28, 31, 19, t$) '15
  3805.     _DELAY (Odelay)
  3806.     CALL VerticalLine(32, 33, 20, t$) '16
  3807.     _DELAY (Odelay)
  3808.     CALL VerticalLine(36, 37, 22, t$) '16_2 -- transferring from graph paper to code, i missed two lines
  3809.     _DELAY (Odelay)
  3810.     CALL VerticalLine(34, 35, 21, t$) '17
  3811.     _DELAY (Odelay)
  3812.     CALL Plot(23, 38, t$) '18
  3813.     _DELAY (Odelay)
  3814.     CALL Plot(25, 41, t$) ' 18_2
  3815.     _DELAY (Odelay)
  3816.     CALL VerticalLine(39, 40, 24, t$) '19
  3817.     _DELAY (Odelay)
  3818.     CALL Plot(26, 42, t$) '20
  3819.     _DELAY (Odelay)
  3820.     CALL HorizontalLine(27, 28, 43, t$) '21
  3821.     _DELAY (Odelay)
  3822.     CALL HorizontalLine(29, 30, 44, t$) '22
  3823.     _DELAY (Odelay)
  3824.     CALL HorizontalLine(31, 33, 45, t$) '23
  3825.     _DELAY (Odelay)
  3826.     CALL HorizontalLine(34, 36, 46, t$) '24
  3827.     _DELAY (Odelay)
  3828.     CALL HorizontalLine(37, 43, 47, t$) '25
  3829.     _DELAY (Odelay)
  3830.     CALL HorizontalLine(44, 46, 46, t$) '26
  3831.     _DELAY (Odelay)
  3832.     CALL HorizontalLine(47, 49, 45, t$) '27
  3833.     _DELAY (Odelay)
  3834.     CALL HorizontalLine(50, 51, 44, t$) '28
  3835.     _DELAY (Odelay)
  3836.     CALL HorizontalLine(52, 53, 43, t$) '29
  3837.     _DELAY (Odelay)
  3838.     CALL Plot(54, 42, t$) '30
  3839.     _DELAY (Odelay)
  3840.     CALL Plot(55, 41, t$) '31
  3841.     _DELAY (Odelay)
  3842.     CALL VerticalLine(39, 40, 56, t$) '32
  3843.     _DELAY (Odelay)
  3844.     CALL Plot(57, 38, t$) '33
  3845.     _DELAY (Odelay)
  3846.     CALL VerticalLine(36, 37, 58, t$) '34
  3847.     _DELAY (Odelay)
  3848.     CALL VerticalLine(34, 35, 59, t$) '35
  3849.     _DELAY (Odelay)
  3850.     CALL VerticalLine(32, 33, 60, t$) '36
  3851.     _DELAY (Odelay)
  3852.     CALL VerticalLine(28, 31, 61, t$) '37
  3853.     _DELAY (Odelay)
  3854.     CALL VerticalLine(23, 27, 62, t$) '38
  3855.     _DELAY (Odelay)
  3856.     CALL VerticalLine(19, 22, 61, t$) '39
  3857.     _DELAY (Odelay)
  3858.     CALL VerticalLine(17, 18, 60, t$) '40
  3859.     _DELAY (Odelay)
  3860.     CALL VerticalLine(15, 16, 59, t$) '41
  3861.     _DELAY (Odelay)
  3862.     CALL VerticalLine(13, 14, 58, t$) '42
  3863.     _DELAY (Odelay)
  3864.     CALL Plot(57, 12, t$) '43
  3865.     _DELAY (Odelay)
  3866.     CALL VerticalLine(10, 11, 56, t$) '44
  3867.     _DELAY (Odelay)
  3868.     CALL Plot(55, 9, t$) '45
  3869.     _DELAY (Odelay)
  3870.     CALL Plot(54, 8, t$) '46
  3871.     _DELAY (Odelay)
  3872.     CALL HorizontalLine(52, 53, 7, t$) '47
  3873.     _DELAY (Odelay)
  3874.     CALL HorizontalLine(50, 51, 6, t$) '48
  3875.     _DELAY (Odelay)
  3876.     CALL HorizontalLine(47, 49, 5, t$) '49
  3877.     _DELAY (Odelay)
  3878.     CALL HorizontalLine(44, 46, 4, t$)
  3879.     _DELAY (1)
  3880.     COLOR 0, 0
  3881.     CLS
  3882.     RETURN
  3883.  
  3884.     'M
  3885.     M: Mdelay = 0.017
  3886.     COLOR 4, 0
  3887.     FOR vPos = 47 TO 3 STEP -1
  3888.         CALL Plot(18, vPos, t$)
  3889.         _DELAY (Mdelay)
  3890.     NEXT vPos
  3891.     hPos = 19
  3892.     FOR vPos = 4 TO 26
  3893.         CALL Plot(hPos, vPos, t$)
  3894.         _DELAY (Mdelay)
  3895.         hPos = hPos + 1
  3896.     NEXT vPos
  3897.     FOR vPos = 25 TO 4 STEP -1
  3898.         CALL Plot(hPos, vPos, t$)
  3899.         _DELAY (Mdelay)
  3900.         hPos = hPos + 1
  3901.     NEXT vPos
  3902.     FOR vPos = 3 TO 47
  3903.         CALL Plot(64, vPos, t$)
  3904.         _DELAY (Mdelay)
  3905.     NEXT vPos
  3906.     _DELAY (2.5)
  3907.     COLOR 0, 0
  3908.     CLS
  3909.     RETURN
  3910.  
  3911.     BoomDenouement:
  3912.     Red = 4
  3913.     Orange = 6
  3914.     Yellow = 14
  3915.     BrightRed = 12
  3916.     usingDelay = 0.33
  3917.     PLAY "MBL32O1CDEFGABL40O2CDEFGAB48O3CDEFGABL56O4CDEFGAB"
  3918.     COLOR Red, 0
  3919.     GOSUB FirstCircle
  3920.     _DELAY (usingDelay)
  3921.     COLOR BrightRed, 0
  3922.     GOSUB SecondCircle
  3923.     COLOR Red, 0
  3924.     GOSUB FirstCircle
  3925.     _DELAY (usingDelay)
  3926.     COLOR Orange, 0
  3927.     GOSUB ThirdCircle
  3928.     COLOR BrightRed, 0
  3929.     GOSUB SecondCircle
  3930.     COLOR Red
  3931.     GOSUB FirstCircle
  3932.     _DELAY (usingDelay)
  3933.     COLOR Yellow, 0
  3934.     GOSUB FourthCircle
  3935.     COLOR Orange, 0
  3936.     GOSUB ThirdCircle
  3937.     COLOR BrightRed, 0
  3938.     GOSUB SecondCircle
  3939.     COLOR Red, 0
  3940.     GOSUB FirstCircle
  3941.     PLAY "MBL64O0CDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDECDE"
  3942.     GOSUB Flash
  3943.     GOSUB B
  3944.     GOSUB O
  3945.     GOSUB O
  3946.     GOSUB M
  3947.     shipLog.ships = shipLog.ships - 1
  3948.     shipLog.score = shipLog.score - 300
  3949.     shipLog.morale = 0
  3950.     shipLog.currentMedSupply = 0
  3951.     shipLog.currentSurvivors = 0
  3952.     shipLog.currentDamage.ship = 0
  3953.     shipLog.currentDamage.medical = 0
  3954.     IF shipLog.ships <> 0 THEN
  3955.         COLOR 15, 0
  3956.         CLS
  3957.         LOCATE 15
  3958.         IF shipLog.ships = 2 THEN
  3959.             PRINT LongCenter$("Your ship was destroyed. You are the sole survivor. You did not go down with the ship. I say " + CHR$(34) + "Shame on you!" + CHR$(34) + " Luckily, you convinced your superiors that you are honorable because of your ability to survive. Anyway, you are now in command of your second Espializer 7.")
  3960.         ELSEIF shipLog.ships = 1 THEN
  3961.             PRINT LongCenter$("Your ship was destroyed. You are the sole survivor. You did not go down with the ship. I say " + CHR$(34) + "Shame on you!" + CHR$(34) + " Luckily, you convinced your superiors that you are honorable (again!) because of your ability to survive. Anyway, you are now in command of your second Espializer 7. Be cautious. You will not get a another ship.")
  3962.         END IF
  3963.         LOCATE 48, GetCenter("Push 'r' to return to the grid.")
  3964.         COLOR 10, 0
  3965.         PRINT "Push " + CHR$(34);
  3966.         COLOR 14, 0
  3967.         PRINT "R";
  3968.         COLOR 10, 0
  3969.         PRINT CHR$(34) + " to ";
  3970.         COLOR 14, 0
  3971.         PRINT "r";
  3972.         COLOR 10, 0
  3973.         PRINT "eturn to the Galaxy Grid."
  3974.         CALL WaitForCharacter("r")
  3975.         PLAY returnBeep
  3976.         COLOR 15, 0
  3977.         CLS
  3978.         CALL PrintGrid
  3979.     ELSE
  3980.         CALL EndOfGame
  3981.     END IF
  3982.  
  3983. SUB InsideBlackHole
  3984.     GOSUB drawAccretionDisc
  3985.     LOCATE 1, 1
  3986.     COLOR 15, 0
  3987.     PRINT "Oh no! Your ship has fallen in to the gravity well of a black hole!"
  3988.     LOCATE 2, 1
  3989.     COLOR 10, 0
  3990.     PRINT "Push ";
  3991.     COLOR 14, 0
  3992.     PRINT "[SPACEBAR]"
  3993.     CALL WaitForCharacter(" ")
  3994.     PLAY "MBL5O5BAGFEDCL14O4BAGFEDCL22O3BAGFEDCO2L30BAGFEDCL38O1BAGFEDCL45O0BAGFEDC"
  3995.  
  3996.     'now the hard part. moving the ship through the blackhole
  3997.     FOR x = 36 TO 45
  3998.         CALL DrawEspializer7("N", x, 5, 0)
  3999.         _DELAY (movingShipDelay * 1.5)
  4000.         CALL DrawEspializer7("N", x, 5, 1)
  4001.         GOSUB drawAccretionDisc
  4002.     NEXT x
  4003.     FOR x = 46 TO 49
  4004.         CALL DrawEspializer7("E", x, 5, 0)
  4005.         _DELAY (movingShipDelay * 1.5)
  4006.         CALL DrawEspializer7("E", x, 5, 1)
  4007.         GOSUB drawAccretionDisc
  4008.     NEXT x
  4009.     FOR y = 7 TO 8
  4010.         CALL DrawEspializer7("S", 50, y, 0)
  4011.         _DELAY (movingShipDelay * 1.5)
  4012.         CALL DrawEspializer7("S", 50, y, 1)
  4013.         GOSUB drawAccretionDisc
  4014.     NEXT y
  4015.     FOR x = 51 TO 53
  4016.         CALL DrawEspializer7("S", x, 9, 0)
  4017.         _DELAY (movingShipDelay * 1.5)
  4018.         CALL DrawEspializer7("S", x, 9, 1)
  4019.         GOSUB drawAccretionDisc
  4020.     NEXT x
  4021.     FOR y = 10 TO 12
  4022.         CALL DrawEspializer7("S", 54, y, 0)
  4023.         _DELAY (movingShipDelay * 1.4)
  4024.         CALL DrawEspializer7("S", 54, y, 1)
  4025.         GOSUB drawAccretionDisc
  4026.     NEXT y
  4027.     FOR y = 13 TO 15
  4028.         CALL DrawEspializer7("W", 55, y, 0)
  4029.         _DELAY (movingShipDelay * 1.4)
  4030.         CALL DrawEspializer7("W", 55, y, 1)
  4031.         GOSUB drawAccretionDisc
  4032.     NEXT y
  4033.     FOR y = 16 TO 18
  4034.         CALL DrawEspializer7("W", 56, y, 0)
  4035.         _DELAY (movingShipDelay * 1.4)
  4036.         CALL DrawEspializer7("W", 56, y, 1)
  4037.         GOSUB drawAccretionDisc
  4038.     NEXT y
  4039.     FOR y = 19 TO 28
  4040.         CALL DrawEspializer7("N", 57, y, 0)
  4041.         _DELAY (movingShipDelay * 1.3)
  4042.         CALL DrawEspializer7("N", 57, y, 1)
  4043.         GOSUB drawAccretionDisc
  4044.     NEXT y
  4045.     FOR y = 29 TO 33
  4046.         CALL DrawEspializer7("E", 56, y, 0)
  4047.         _DELAY (movingShipDelay * 1.3)
  4048.         CALL DrawEspializer7("E", 56, y, 1)
  4049.         GOSUB drawAccretionDisc
  4050.     NEXT y
  4051.     FOR x = 55 TO 53 STEP -1
  4052.         CALL DrawEspializer7("E", x, 34, 0)
  4053.         _DELAY (movingShipDelay * 1.2)
  4054.         CALL DrawEspializer7("E", x, 34, 1)
  4055.         GOSUB drawAccretionDisc
  4056.     NEXT x
  4057.     FOR y = 35 TO 36
  4058.         CALL DrawEspializer7("E", 52, y, 0)
  4059.         _DELAY (movingShipDelay * 1.1)
  4060.         CALL DrawEspializer7("E", 52, y, 1)
  4061.         GOSUB drawAccretionDisc
  4062.     NEXT y
  4063.     FOR x = 51 TO 49 STEP -1
  4064.         CALL DrawEspializer7("S", x, 37, 0)
  4065.         _DELAY (movingShipDelay * 1.1)
  4066.         CALL DrawEspializer7("S", x, 37, 1)
  4067.         GOSUB drawAccretionDisc
  4068.     NEXT x
  4069.     FOR x = 48 TO 46 STEP -1
  4070.         CALL DrawEspializer7("S", x, 38, 0)
  4071.         _DELAY (movingShipDelay * 1.1)
  4072.         CALL DrawEspializer7("S", x, 38, 1)
  4073.         GOSUB drawAccretionDisc
  4074.     NEXT x
  4075.     FOR x = 45 TO 39 STEP -1
  4076.         CALL DrawEspializer7("W", x, 39, 0)
  4077.         _DELAY (movingShipDelay * 1)
  4078.         CALL DrawEspializer7("W", x, 39, 1)
  4079.         GOSUB drawAccretionDisc
  4080.     NEXT x
  4081.     FOR x = 38 TO 37 STEP -1
  4082.         CALL DrawEspializer7("W", x, 38, 0)
  4083.         _DELAY (movingShipDelay * 1)
  4084.         CALL DrawEspializer7("W", x, 38, 1)
  4085.         GOSUB drawAccretionDisc
  4086.     NEXT x
  4087.     CALL DrawEspializer7("N", 36, 37, 0)
  4088.     _DELAY (movingShipDelay * 1)
  4089.     CALL DrawEspializer7("N", 36, 37, 1)
  4090.     GOSUB drawAccretionDisc
  4091.     CALL DrawEspializer7("N", 35, 36, 0)
  4092.     _DELAY (movingShipDelay * 1)
  4093.     CALL DrawEspializer7("N", 35, 36, 1)
  4094.     GOSUB drawAccretionDisc
  4095.     CALL DrawEspializer7("N", 34, 35, 0)
  4096.     _DELAY (movingShipDelay * 0.9)
  4097.     CALL DrawEspializer7("N", 34, 35, 1)
  4098.     GOSUB drawAccretionDisc
  4099.     CALL DrawEspializer7("N", 33, 34, 0)
  4100.     _DELAY (movingShipDelay * 0.9)
  4101.     CALL DrawEspializer7("N", 33, 34, 1)
  4102.     GOSUB drawAccretionDisc
  4103.     FOR y = 33 TO 32 STEP -1
  4104.         CALL DrawEspializer7("E", 32, y, 0)
  4105.         _DELAY (movingShipDelay * 0.9)
  4106.         CALL DrawEspializer7("E", 32, y, 1)
  4107.         GOSUB drawAccretionDisc
  4108.     NEXT y
  4109.     FOR y = 31 TO 30 STEP -1
  4110.         CALL DrawEspializer7("E", 31, y, 0)
  4111.         _DELAY (movingShipDelay * 0.8)
  4112.         CALL DrawEspializer7("E", 31, y, 1)
  4113.         GOSUB drawAccretionDisc
  4114.     NEXT y
  4115.     FOR y = 29 TO 22 STEP -1
  4116.         CALL DrawEspializer7("S", 30, y, 0)
  4117.         _DELAY (movingShipDelay * 0.8)
  4118.         CALL DrawEspializer7("S", 30, y, 1)
  4119.         GOSUB drawAccretionDisc
  4120.     NEXT y
  4121.     FOR y = 21 TO 20 STEP -1
  4122.         CALL DrawEspializer7("S", 31, y, 0)
  4123.         _DELAY (movingShipDelay * 0.8)
  4124.         CALL DrawEspializer7("S", 31, y, 1)
  4125.         GOSUB drawAccretionDisc
  4126.     NEXT y
  4127.     CALL DrawEspializer7("W", 32, 19, 0)
  4128.     _DELAY (movingShipDelay * 0.7)
  4129.     CALL DrawEspializer7("W", 32, 19, 1)
  4130.     GOSUB drawAccretionDisc
  4131.     FOR x = 33 TO 34
  4132.         CALL DrawEspializer7("W", x, 18, 0)
  4133.         _DELAY (movingshipdelsy * 0.7)
  4134.         CALL DrawEspializer7("W", x, 18, 1)
  4135.         GOSUB drawAccretionDisc
  4136.     NEXT x
  4137.     FOR x = 35 TO 39
  4138.         CALL DrawEspializer7("W", x, 17, 0)
  4139.         _DELAY (movingshipdelsy * 0.7)
  4140.         CALL DrawEspializer7("W", x, 17, 1)
  4141.         GOSUB drawAccretionDisc
  4142.     NEXT x
  4143.     FOR x = 40 TO 45
  4144.         CALL DrawEspializer7("N", x, 17, 0)
  4145.         _DELAY (movingshipdelsy * 0.6)
  4146.         CALL DrawEspializer7("N", x, 17, 1)
  4147.         GOSUB drawAccretionDisc
  4148.     NEXT x
  4149.     CALL DrawEspializer7("E", 46, 18, 0)
  4150.     _DELAY (movingShipDelay * 0.6)
  4151.     CALL DrawEspializer7("E", 46, 18, 1)
  4152.     GOSUB drawAccretionDisc
  4153.     CALL DrawEspializer7("E", 47, 19, 0)
  4154.     _DELAY (movingShipDelay * 0.6)
  4155.     CALL DrawEspializer7("W", 47, 19, 1)
  4156.     GOSUB drawAccretionDisc
  4157.     FOR y = 20 TO 25
  4158.         CALL DrawEspializer7("E", 48, y, 0)
  4159.         _DELAY (mocingshipdelay * 0.5)
  4160.         CALL DrawEspializer7("E", 48, y, 1)
  4161.         GOSUB drawAccretionDisc
  4162.     NEXT y
  4163.     CALL DrawEspializer7("S", 47, 26, 0)
  4164.     _DELAY (movingShipDelay * 0.5)
  4165.     CALL DrawEspializer7("S", 47, 26, 1)
  4166.     GOSUB drawAccretionDisc
  4167.     CALL DrawEspializer7("S", 46, 27, 0)
  4168.     _DELAY (movingShipDelay * 0.5)
  4169.     CALL DrawEspializer7("S", 46, 27, 1)
  4170.     GOSUB drawAccretionDisc
  4171.     FOR x = 45 TO 44 STEP -1
  4172.         CALL DrawEspializer7("S", x, 28, 0)
  4173.         _DELAY (movingShipDelay * 0.4)
  4174.         CALL DrawEspializer7("S", x, 28, 1)
  4175.         GOSUB drawAccretionDisc
  4176.     NEXT x
  4177.     FOR x = 43 TO 41 STEP -1
  4178.         CALL DrawEspializer7("W", x, 29, 0)
  4179.         _DELAY (movingShipDelay * 0.4)
  4180.         CALL DrawEspializer7("W", x, 29, 1)
  4181.         GOSUB drawAccretionDisc
  4182.     NEXT x
  4183.     FOR x = 40 TO 39 STEP -1
  4184.         CALL DrawEspializer7("W", x, 28, 0)
  4185.         _DELAY (movingShipDelay * 0.4)
  4186.         CALL DrawEspializer7("W", x, 28, 1)
  4187.         GOSUB drawAccretionDisc
  4188.     NEXT x
  4189.     CALL DrawEspializer7("W", 38, 27, 0)
  4190.     _DELAY (movingShipDelay * 0.37)
  4191.     CALL DrawEspializer7("W", 38, 27, 1)
  4192.     GOSUB drawAccretionDisc
  4193.     FOR y = 26 TO 23 STEP -1
  4194.         CALL DrawEspializer7("N", 37, y, 0)
  4195.         _DELAY (movingShipDelay * 0.37)
  4196.         CALL DrawEspializer7("N", 37, y, 0)
  4197.         GOSUB drawAccretionDisc
  4198.     NEXT y
  4199.     FOR x = 38 TO 41
  4200.         CALL DrawEspializer7("E", x, 22, 0)
  4201.         _DELAY (movingShipDelay * 0.37)
  4202.         CALL DrawEspializer7("E", x, 22, 0)
  4203.         GOSUB drawAccretionDisc
  4204.     NEXT x
  4205.     'spin
  4206.     CALL DrawEspializer7("S", x, 22, 0)
  4207.     _DELAY (movingShipDelay * 0.37)
  4208.     CALL DrawEspializer7("S", x, 22, 0)
  4209.     GOSUB drawAccretionDisc
  4210.     CALL DrawEspializer7("W", x, 22, 0)
  4211.     _DELAY (movingShipDelay * 0.37)
  4212.     CALL DrawEspializer7("W", x, 22, 0)
  4213.     GOSUB drawAccretionDisc
  4214.     CALL DrawEspializer7("N", x, 22, 0)
  4215.     _DELAY (movingShipDelay * 0.37)
  4216.     CALL DrawEspializer7("N", x, 22, 0)
  4217.     GOSUB drawAccretionDisc
  4218.     CALL DrawEspializer7("E", x, 22, 0)
  4219.     _DELAY (movingShipDelay * 0.37)
  4220.     CALL DrawEspializer7("E", x, 22, 0)
  4221.     GOSUB drawAccretionDisc
  4222.     GOTO endBlackHole
  4223.  
  4224.     drawAccretionDisc:
  4225.     COLOR 8, 0
  4226.     CLS
  4227.     CALL HorizontalLine(38, 43, 2, t$) 'outer arc
  4228.     CALL HorizontalLine(44, 47, 3, t$)
  4229.     CALL HorizontalLine(48, 49, 4, t$)
  4230.     CALL HorizontalLine(50, 51, 5, t$)
  4231.     CALL HorizontalLine(52, 53, 6, t$)
  4232.     CALL Plot(54, 7, t$)
  4233.     CALL Plot(55, 8, t$)
  4234.     CALL Plot(56, 9, t$)
  4235.     CALL Plot(57, 10, t$)
  4236.     CALL VerticalLine(11, 12, 58, t$)
  4237.     CALL Plot(59, 13, t$)
  4238.     CALL VerticalLine(14, 15, 60, t$)
  4239.     CALL VerticalLine(16, 18, 61, t$)
  4240.     CALL VerticalLine(19, 22, 62, t$)
  4241.     CALL VerticalLine(23, 27, 63, t$)
  4242.     CALL VerticalLine(28, 31, 62, t$)
  4243.     CALL VerticalLine(32, 34, 61, t$)
  4244.     CALL VerticalLine(35, 36, 60, t$)
  4245.     CALL Plot(59, 37, t$)
  4246.     CALL VerticalLine(38, 39, 58, t$)
  4247.     CALL Plot(57, 40, t$)
  4248.     CALL Plot(56, 41, t$)
  4249.     CALL Plot(55, 42, t$)
  4250.     CALL HorizontalLine(53, 54, 43, t$)
  4251.     CALL HorizontalLine(51, 52, 44, t$)
  4252.     CALL HorizontalLine(49, 50, 45, t$)
  4253.     CALL HorizontalLine(46, 48, 46, t$)
  4254.     CALL HorizontalLine(39, 45, 47, t$)
  4255.     CALL HorizontalLine(36, 43, 43, t$) ' left side outer arc
  4256.     CALL HorizontalLine(33, 35, 42, t$)
  4257.     CALL HorizontalLine(31, 32, 41, t$)
  4258.     CALL HorizontalLine(29, 30, 40, t$)
  4259.     CALL Plot(28, 39, t$)
  4260.     CALL Plot(27, 38, t$)
  4261.     CALL VerticalLine(36, 37, 26, t$)
  4262.     CALL Plot(25, 35, t$)
  4263.     CALL VerticalLine(33, 34, 24, t$)
  4264.     CALL VerticalLine(30, 32, 23, t$)
  4265.     CALL VerticalLine(20, 29, 22, t$)
  4266.     CALL VerticalLine(18, 19, 23, t$)
  4267.     CALL VerticalLine(16, 17, 24, t$)
  4268.     CALL VerticalLine(14, 15, 25, t$)
  4269.     CALL Plot(26, 13, t$)
  4270.     CALL Plot(27, 12, t$)
  4271.     CALL HorizontalLine(28, 29, 11, t$)
  4272.     CALL Plot(30, 10, t$)
  4273.     CALL HorizontalLine(31, 32, 9, t$)
  4274.     CALL HorizontalLine(33, 35, 8, t$)
  4275.     CALL HorizontalLine(36, 44, 7, t$)
  4276.     CALL HorizontalLine(35, 36, 14, t$) 'right side inner arc
  4277.     CALL HorizontalLine(37, 43, 13, t$)
  4278.     CALL HorizontalLine(44, 46, 14, t$)
  4279.     CALL Plot(47, 15, t$)
  4280.     CALL Plot(48, 16, t$)
  4281.     CALL Plot(49, 17, t$)
  4282.     CALL VerticalLine(18, 19, 50, t$)
  4283.     CALL VerticalLine(20, 22, 51, t$)
  4284.     CALL VerticalLine(23, 28, 52, t$)
  4285.     CALL VerticalLine(29, 30, 51, t$)
  4286.     CALL VerticalLine(31, 32, 50, t$)
  4287.     CALL Plot(49, 33, t$)
  4288.     CALL Plot(48, 34, t$)
  4289.     CALL HorizontalLine(46, 47, 35, t$)
  4290.     CALL HorizontalLine(43, 45, 36, t$)
  4291.     CALL HorizontalLine(39, 42, 37, t$)
  4292.     CALL HorizontalLine(38, 42, 31, t$) ' smallest arc
  4293.     CALL HorizontalLine(36, 37, 30, t$)
  4294.     CALL VerticalLine(28, 29, 35, t$)
  4295.     CALL VerticalLine(23, 27, 34, t$)
  4296.     CALL VerticalLine(21, 22, 35, t$)
  4297.     CALL Plot(36, 20, t$)
  4298.     CALL HorizontalLine(37, 42, 19, t$)
  4299.     CALL Plot(43, 20, t$)
  4300.     RETURN
  4301.  
  4302.     endBlackHole:
  4303.     CALL Boom
  4304.  
  4305. SUB PrintGrid
  4306.     FOR x = 1 TO 80
  4307.         FOR y = 1 TO 45
  4308.             IF grid(x, y, 3) <> 0 THEN
  4309.                 LOCATE y, x
  4310.                 COLOR grid(x, y, 2), 0
  4311.                 PRINT CHR$(grid(x, y, 1))
  4312.             END IF
  4313.         NEXT y
  4314.     NEXT x
  4315.     COLOR esplzr.clr, 0
  4316.     LOCATE Espializer7.y, Espializer7.x
  4317.     PRINT CHR$(esplzr.code)
  4318.     COLOR 15, 0
  4319.     LOCATE 46
  4320.     a$ = LTRIM$(STR$(Espializer7.x))
  4321.     b$ = LTRIM$(STR$(Espializer7.y))
  4322.     gameInProgress = 1
  4323.     CALL ClearStatus
  4324.     CALL Status
  4325.  
  4326. SUB SetGameElements
  4327.     COLOR 0, 0
  4328.     CLS
  4329.     'Set shipLog
  4330.     shipLog.ships = 3
  4331.     shipLog.morale = 0
  4332.     shipLog.score = 0
  4333.     shipLog.currentDamage.ship = 0
  4334.     shipLog.currentDamage.medical = 0
  4335.     shipLog.totalDamage.ship = 0
  4336.     shipLog.totalDamage.medical = 0
  4337.     shipLog.currentSurvivors = 0
  4338.     shipLog.totalSurvivorsSaved = 0
  4339.     shipLog.enemiesDestroyed = 0
  4340.     shipLog.currentMedSupply = 0
  4341.     shipLog.totalMedSupply = 0
  4342.  
  4343.     max = 40
  4344.     min = 20
  4345.     jump = INT(RND * (max - min + 1)) + min
  4346.     fleetJumpsWhenThisReaches0 = jump
  4347.     shipsInSarienFleet = 10
  4348.  
  4349.     'Wifran colonies
  4350.     PLAY "L32O2C"
  4351.     FOR cnt = 1 TO 50
  4352.         redoColony:
  4353.         randomX = RNX
  4354.         randomY = RNY
  4355.         IF grid(randomX, randomY, 1) = 0 THEN
  4356.             grid(randomX, randomY, 1) = wifranColony.code
  4357.             grid(randomX, randomY, 2) = wifranColony.clr
  4358.             grid(randomX, randomY, 3) = INT(RND * 9) + 1 'number of survivors allowed on planet (1 to 10)
  4359.             COLOR wifranColony.clr, 0
  4360.             LOCATE randomY, randomX
  4361.             PRINT CHR$(wifranColony.code)
  4362.         ELSE
  4363.             GOTO redoColony
  4364.         END IF
  4365.         _DELAY (0.011)
  4366.     NEXT cnt
  4367.  
  4368.     'space stations
  4369.     PLAY "L32O2D"
  4370.     FOR cnt = 1 TO 10
  4371.         redoBottomase:
  4372.         randomX = RNX
  4373.         randomY = RNY
  4374.         IF randomY + 1 = 46 THEN GOTO redoBottomase
  4375.         IF grid(randomX, randomY, 1) = 0 AND grid(randomX, randomY + 1, 1) = 0 AND randomY + 1 <= 45 THEN
  4376.             grid(randomX, randomY, 1) = Top.code
  4377.             grid(randomX, randomY + 1, 1) = Bottom.code
  4378.             grid(randomX, randomY, 2) = Top.clr
  4379.             grid(randomX, randomY + 1, 2) = Bottom.clr
  4380.             grid(randomX, randomY, 3) = 1
  4381.             grid(randomX, randomY + 1, 3) = 1 'not really needed. s are always there
  4382.             COLOR Top.clr
  4383.             LOCATE randomY, randomX
  4384.             PRINT CHR$(Top.code)
  4385.             LOCATE randomY + 1, randomX
  4386.             PRINT CHR$(Bottom.code)
  4387.         ELSE
  4388.             GOTO redoBottomase
  4389.         END IF
  4390.         COLOR 15, 0
  4391.         _DELAY (0.05)
  4392.     NEXT cnt
  4393.  
  4394.     'Planets not aligned with the Wifran empire that are also enemies of the Sariens
  4395.     PLAY "L32O2E"
  4396.     FOR cnt = 1 TO 50
  4397.         redoOtherPlanet:
  4398.         randomX = RNX
  4399.         randomY = RNY
  4400.         IF grid(randomX, randomY, 1) = 0 THEN
  4401.             grid(randomX, randomY, 1) = otherPlanet.code
  4402.             grid(randomX, randomY, 2) = otherPlanet.clr
  4403.             grid(randomX, randomY, 3) = (INT(RND * 6) + 2) ' number of medkits offered (2 to 7)
  4404.             COLOR otherPlanet.clr, 0
  4405.             LOCATE randomY, randomX
  4406.             PRINT CHR$(otherPlanet.code)
  4407.         ELSE
  4408.             GOTO redoOtherPlanet
  4409.         END IF
  4410.         _DELAY (0.011)
  4411.     NEXT cnt
  4412.  
  4413.     'Informants
  4414.     PLAY "L32O2F"
  4415.     FOR cnt = 1 TO 10
  4416.         redoInformant:
  4417.         randomX = RNX
  4418.         randomY = RNY
  4419.         IF grid(randomX, randomY, 1) = 0 THEN
  4420.             grid(randomX, randomY, 1) = informant.code
  4421.             grid(randomX, randomY, 2) = informant.clr
  4422.             grid(randomX, randomY, 3) = cnt 'which informant is which
  4423.         ELSE
  4424.             GOTO redoInformant
  4425.         END IF
  4426.         COLOR 6, 0
  4427.         LOCATE randomY, randomX
  4428.         PRINT CHR$(213)
  4429.         _DELAY (0.05)
  4430.     NEXT cnt
  4431.  
  4432.     'Sarien Heavy Crusiers
  4433.     PLAY "L32O2G"
  4434.     FOR cnt = 1 TO 20
  4435.         redoCruiser:
  4436.         randomX = RNX
  4437.         randomY = RNY
  4438.         IF grid(randomX, randomY, 1) = 0 THEN
  4439.             grid(randomX, randomY, 1) = sarienShip.code
  4440.             grid(randomX, randomY, 2) = sarienShip.clr
  4441.             grid(randomX, randomY, 3) = 11
  4442.         ELSE
  4443.             GOTO redoCruiser
  4444.         END IF
  4445.         COLOR sarienShip.clr
  4446.         LOCATE randomY, randomX
  4447.         PRINT CHR$(sarienShip.code)
  4448.         _DELAY (0.025)
  4449.     NEXT cnt
  4450.  
  4451.     'Disabled Wifran ships
  4452.     PLAY "L32O2A"
  4453.     FOR cnt = 1 TO 25
  4454.         disabledShip:
  4455.         randomX = RNX
  4456.         randomY = RNY
  4457.         IF grid(randomX, randomY, 1) = 0 THEN
  4458.             grid(randomX, randomY, 1) = disabledShip.code
  4459.             grid(randomX, randomY, 2) = disabledShip.clr
  4460.             grid(randomX, randomY, 3) = INT(RND * (9 - 2 + 1)) + 2 'number of survivors still on board
  4461.         ELSE
  4462.             GOTO disabledShip
  4463.         END IF
  4464.         COLOR 12, 0
  4465.         LOCATE randomY, randomX
  4466.         PRINT CHR$(15)
  4467.         _DELAY (0.015)
  4468.     NEXT cnt
  4469.  
  4470.     'Black holes
  4471.     PLAY "L32O2B"
  4472.     FOR cnt = 1 TO 10
  4473.         redoBlackHole:
  4474.         randomX = RNX
  4475.         randomY = RNY
  4476.         IF grid(randomX, randomY, 1) = 0 THEN
  4477.             grid(randomX, randomY, 1) = blackHole.code
  4478.             grid(randomX, randomY, 2) = blackHole.clr
  4479.             grid(randomX, randomY, 3) = 1
  4480.         ELSE
  4481.             GOTO redoBlackHole
  4482.         END IF
  4483.         COLOR 8, 0
  4484.         LOCATE randomY, randomX
  4485.         PRINT CHR$(blackHole.code)
  4486.         _DELAY (0.05)
  4487.     NEXT cnt
  4488.  
  4489.     'Wormholes
  4490.     PLAY "L32O3C"
  4491.     FOR cnt = 1 TO 20
  4492.         redoWormHole:
  4493.         randomX = RNX
  4494.         randomY = RNY
  4495.         IF grid(randomX, randomY, 1) = 0 THEN
  4496.             '            wormHoles(cnt).x = randomX
  4497.             '            wormHoles(cnt).y = randomY
  4498.             '            wormHoles(cnt).f = cnt
  4499.             IF cnt <= 10 THEN
  4500.                 grid(randomX, randomY, 1) = cnt + 64
  4501.                 COLOR wormHole.clr, 0
  4502.                 LOCATE randomY, randomX
  4503.                 PRINT CHR$(cnt + 64)
  4504.             ELSE
  4505.                 grid(randomX, randomY, 1) = cnt + 54
  4506.                 COLOR wormHole.clr, 0
  4507.                 LOCATE randomY, randomX
  4508.                 PRINT CHR$(cnt + 54)
  4509.             END IF
  4510.             grid(randomX, randomY, 2) = wormHole.clr
  4511.             grid(randomX, randomY, 3) = cnt
  4512.         ELSE
  4513.             GOTO redoWormHole
  4514.         END IF
  4515.     NEXT cnt
  4516.     _DELAY (0.5)
  4517.  
  4518.     'The Sarien Fleet
  4519.     PLAY "L32O3D"
  4520.     redoFleet:
  4521.     randomX = RNX
  4522.     randomY = RNY
  4523.     IF randomX = 80 OR randomY = 45 THEN GOTO redoFleet
  4524.     IF grid(randomX, randomY, 1) = 0 AND grid(randomX + 1, randomY, 1) = 0 AND grid(randomX, randomY + 1, 1) = 0 AND grid(randomX + 1, randomY + 1, 1) = 0 THEN
  4525.         grid(randomX, randomY, 1) = sarienFleet.code
  4526.         grid(randomX, randomY, 2) = sarienFleet.clr
  4527.         newFlag = 10
  4528.         sarienJumpOn = jump
  4529.         grid(randomX, randomY, 3) = newFlag
  4530.         grid(randomX + 1, randomY, 1) = sarienFleet.code
  4531.         grid(randomX + 1, randomY, 2) = sarienFleet.clr
  4532.         grid(randomX + 1, randomY, 3) = newFlag
  4533.         grid(randomX, randomY + 1, 1) = sarienFleet.code
  4534.         grid(randomX, randomY + 1, 2) = sarienFleet.clr
  4535.         grid(randomX, randomY + 1, 3) = newFlag
  4536.         grid(randomX + 1, randomY + 1, 1) = sarienFleet.code
  4537.         grid(randomX + 1, randomY + 1, 2) = sarienFleet.clr
  4538.         grid(randomX + 1, randomY + 1, 3) = newFlag
  4539.     ELSE
  4540.         GOTO redoFleet
  4541.     END IF
  4542.     COLOR 2, 0
  4543.     LOCATE randomY, randomX
  4544.     PRINT CHR$(176)
  4545.     LOCATE randomY, randomX + 1
  4546.     PRINT CHR$(176)
  4547.     LOCATE randomY + 1, randomX
  4548.     PRINT CHR$(176)
  4549.     LOCATE randomY + 1, randomX + 1
  4550.     PRINT CHR$(176)
  4551.     _DELAY (0.5)
  4552.  
  4553.     'espializer 7
  4554.     PLAY "L32O3E"
  4555.     anotherX = 0
  4556.     anotherY = 1
  4557.     redoespializer7:
  4558.     anotherX = anotherX + 1
  4559.     IF grid(anotherX, anotherY, 1) = 0 THEN
  4560.         Espializer7.x = anotherX
  4561.         Espializer7.y = anotherY
  4562.         Espializer7.f = 1
  4563.     ELSEIF anotherX = 0 OR anotherY = 0 OR anotherX > 80 OR anotherY > 45 THEN
  4564.         GOTO redoespializer7
  4565.     ELSE
  4566.         GOTO redoespializer7
  4567.     END IF
  4568.     COLOR 11, 1
  4569.     LOCATE Espializer7.y, Espializer7.x
  4570.     PRINT CHR$(234)
  4571.     _DELAY (0.5)
  4572.  
  4573.     CALL PrintGrid
  4574.     gameInProgress = 1
  4575.  
  4576. 'SUB l
  4577. 'END SUB
  4578.  
  4579. SUB ClearStatus
  4580.     LOCATE 46, 1
  4581.     PRINT "                                                                               "
  4582.     PRINT "                                                                               "
  4583.     PRINT "                                                                               "
  4584.  
  4585.     rtn = INT(RND * 80) + 1
  4586.     RNX = rtn
  4587.  
  4588.     rtn = INT(RND * 45) + 1
  4589.     RNY = rtn
  4590.  
  4591. SUB VisitPlanet
  4592.     COLOR 0, 0
  4593.     CLS
  4594.  
  4595.     'Draw the ocean part of the planet
  4596.     COLOR 1
  4597.     CALL HorizontalLine(1, 32, 45, CHR$(219))
  4598.     CALL HorizontalLine(2, 32, 44, CHR$(219))
  4599.     CALL HorizontalLine(3, 33, 43, CHR$(219))
  4600.     CALL HorizontalLine(4, 33, 42, CHR$(219))
  4601.     CALL HorizontalLine(6, 34, 41, CHR$(219))
  4602.     CALL HorizontalLine(7, 34, 40, CHR$(219))
  4603.     CALL HorizontalLine(8, 35, 39, CHR$(219))
  4604.     CALL HorizontalLine(10, 36, 38, CHR$(219))
  4605.     CALL HorizontalLine(12, 37, 37, CHR$(219))
  4606.     CALL HorizontalLine(13, 39, 36, CHR$(219))
  4607.     CALL HorizontalLine(68, 69, 36, CHR$(219))
  4608.     CALL HorizontalLine(15, 41, 35, CHR$(219))
  4609.     CALL HorizontalLine(53, 69, 35, CHR$(219))
  4610.     CALL HorizontalLine(16, 45, 34, CHR$(219))
  4611.     CALL HorizontalLine(50, 68, 34, CHR$(219))
  4612.     CALL HorizontalLine(18, 67, 33, CHR$(219))
  4613.     CALL HorizontalLine(20, 65, 32, CHR$(219))
  4614.     CALL HorizontalLine(22, 64, 31, CHR$(219))
  4615.     CALL HorizontalLine(24, 62, 30, CHR$(219))
  4616.     CALL HorizontalLine(26, 60, 29, CHR$(219))
  4617.     CALL HorizontalLine(28, 58, 28, CHR$(219))
  4618.     CALL HorizontalLine(31, 56, 27, CHR$(219))
  4619.     CALL HorizontalLine(35, 53, 26, CHR$(219))
  4620.     CALL HorizontalLine(40, 50, 25, CHR$(219))
  4621.  
  4622.     'Draw the forest part of the planet
  4623.     COLOR 2
  4624.     CALL HorizontalLine(33, 52, 45, CHR$(219))
  4625.     CALL HorizontalLine(33, 53, 44, CHR$(219))
  4626.     CALL HorizontalLine(34, 54, 43, CHR$(219))
  4627.     CALL HorizontalLine(34, 55, 42, CHR$(219))
  4628.     CALL HorizontalLine(35, 56, 41, CHR$(219))
  4629.     CALL HorizontalLine(35, 57, 40, CHR$(219))
  4630.     CALL HorizontalLine(36, 65, 39, CHR$(219))
  4631.     CALL HorizontalLine(37, 67, 38, CHR$(219))
  4632.     CALL HorizontalLine(38, 70, 37, CHR$(219))
  4633.     CALL HorizontalLine(40, 67, 36, CHR$(219))
  4634.     CALL HorizontalLine(42, 52, 35, CHR$(219))
  4635.     CALL HorizontalLine(46, 49, 34, CHR$(219))
  4636.     CALL Plot(70, 36, CHR$(219))
  4637.  
  4638.     'Draw the dirt/other colored land part of the planet
  4639.     COLOR 6
  4640.     CALL HorizontalLine(53, 80, 45, CHR$(219))
  4641.     CALL HorizontalLine(54, 79, 44, CHR$(219))
  4642.     CALL HorizontalLine(55, 78, 43, CHR$(219))
  4643.     CALL HorizontalLine(56, 77, 42, CHR$(219))
  4644.     CALL HorizontalLine(57, 76, 41, CHR$(219))
  4645.     CALL HorizontalLine(58, 75, 40, CHR$(219))
  4646.     CALL HorizontalLine(66, 74, 39, CHR$(219))
  4647.     CALL HorizontalLine(68, 73, 38, CHR$(219))
  4648.     CALL HorizontalLine(71, 72, 37, CHR$(219))
  4649.     CALL Plot(71, 36, CHR$(219))
  4650.  
  4651.     'Draw the Espializer7 in the upper right portion of the screen
  4652.     CALL DrawEspializer7("W", 76, 9, 0)
  4653.  
  4654.     'Display message
  4655.     COLOR 15, 0
  4656.     a$ = "The Espializer 7 has arrived at a planet"
  4657.     b$ = "known for its medical expertise."
  4658.     LOCATE 6, 16
  4659.     PRINT a$
  4660.     LOCATE 7, 20
  4661.     PRINT b$
  4662.     c$ = "Push [spacebar] to move into orbit"
  4663.     LOCATE 12, 25
  4664.     COLOR 10, 0
  4665.     PRINT "Push ";
  4666.     COLOR 14, 0
  4667.     PRINT "[SPACEBAR]";
  4668.     COLOR 10, 0
  4669.     PRINT " to move into orbit."
  4670.     CALL WaitForCharacter(" ")
  4671.     'Move Espializer7
  4672.     FOR x = 76 TO 16 STEP -1
  4673.         CALL DrawEspializer7("W", x, 9, 0)
  4674.         _DELAY (movingShipDelay)
  4675.         IF x <= 55 AND x >= 16 THEN
  4676.             IF x MOD 3 = 0 THEN PLAY runOverText$
  4677.         ELSE
  4678.             IF x MOD movingShipMod = 0 THEN PLAY movingShipBeep
  4679.         END IF
  4680.         CALL DrawEspializer7("W", x, 9, 1)
  4681.     NEXT x
  4682.  
  4683.     'Rotate the Espializer7 90 degrees counter-clockwise
  4684.     CALL DrawEspializer7("S", 12, 5, 0)
  4685.     PLAY movingShipBeep
  4686.     a$ = "Push -esc- to hail the people of this planet."
  4687.     LOCATE 10, GetCenter(a$)
  4688.     COLOR 10, 0
  4689.     PRINT "Push ";
  4690.     COLOR 14, 0
  4691.     PRINT "[ESC]";
  4692.     COLOR 10, 0
  4693.     PRINT " to hail the people of this planet."
  4694.     CALL WaitForCharacter(CHR$(27))
  4695.     PLAY hail
  4696.     LOCATE 10, GetCenter(a$)
  4697.     PRINT STRING$(LEN(a$), " ")
  4698.     _DELAY (hailDelay)
  4699.  
  4700.     IF grid(Espializer7.x, Espializer7.y, 3) > 0 THEN
  4701.         numMedKits = grid(Espializer7.x, Espializer7.y, 3)
  4702.  
  4703.         COLOR 15, 0
  4704.         ClearStatus
  4705.         COLOR 15, 0
  4706.         a$ = "The concerned people of this world have offered"
  4707.         LOCATE 12, GetCenter(a$)
  4708.         PRINT a$
  4709.         d$ = "you a box of # medical kits to"
  4710.         LOCATE 13, GetCenter(d$)
  4711.         PRINT "you a box of ";
  4712.         COLOR 12, 0
  4713.         PRINT LTRIM$(STR$(numMedKits));
  4714.         COLOR 15, 0
  4715.         PRINT " medical kits to"
  4716.         b$ = "help you battle the evil Sariens."
  4717.         LOCATE 14, GetCenter(b$)
  4718.         PRINT b$
  4719.         IF shipLog.currentMedSupply + numMedKits <= 15 THEN
  4720.             c$ = "Push [spacebar] to accept or n to decline."
  4721.             LOCATE 19, GetCenter(c$)
  4722.             COLOR 10, 0
  4723.             PRINT "Push ";
  4724.             COLOR 14, 0
  4725.             PRINT "[SPACEBAR]";
  4726.             COLOR 10, 0
  4727.             PRINT " to accept or ";
  4728.             PRINT CHR$(34);
  4729.             COLOR 14, 0
  4730.             PRINT "D";
  4731.             COLOR 10, 0
  4732.             PRINT CHR$(34);
  4733.             PRINT " to ";
  4734.             COLOR 14, 0
  4735.             PRINT "d";
  4736.             COLOR 10, 0
  4737.             PRINT "ecline.     "
  4738.             DO
  4739.                 pause$ = INKEY$
  4740.                 pause$ = UCASE$(pause$)
  4741.             LOOP UNTIL pause$ = CHR$(32) OR pause$ = "D"
  4742.             LOCATE 12, GetCenter(a$)
  4743.             PRINT STRING$(LEN(a$), " ")
  4744.             LOCATE 13, GetCenter(d$)
  4745.             PRINT STRING$(LEN(d$), " ")
  4746.             LOCATE 14, GetCenter(b$)
  4747.             PRINT STRING$(LEN(b$), " ")
  4748.             LOCATE 19, GetCenter(t$)
  4749.             PRINT STRING$(LEN(t$), " ")
  4750.             IF pause$ = "D" THEN
  4751.                 PLAY errorBeep$
  4752.                 GOTO anotherEndSub
  4753.             ELSE
  4754.                 shipLog.currentMedSupply = shipLog.currentMedSupply + numMedKits
  4755.                 shipLog.score = shipLog.score + (5 * numMedKits)
  4756.                 grid(Espializer7.x, Espializer7.y, 3) = -1
  4757.             END IF
  4758.             ClearStatus
  4759.             PLAY beamingBeep
  4760.             FOR y = 32 TO 10 STEP -1
  4761.                 IF y <= 31 THEN 'Put the planet back
  4762.                     COLOR 1
  4763.                     CALL HorizontalLine(8, 14, 40, CHR$(219))
  4764.                 END IF
  4765.                 IF y <= 30 THEN
  4766.                     COLOR 1
  4767.                     CALL HorizontalLine(8, 14, 39, CHR$(219))
  4768.                 END IF
  4769.                 IF y <= 29 THEN
  4770.                     COLOR 1
  4771.                     CALL HorizontalLine(10, 14, 38, CHR$(219))
  4772.                 END IF
  4773.                 IF y <= 28 THEN
  4774.                     COLOR 1
  4775.                     CALL HorizontalLine(12, 14, 37, CHR$(219))
  4776.                 END IF
  4777.                 IF y <= 27 THEN
  4778.                     COLOR 1
  4779.                     CALL HorizontalLine(13, 14, 36, CHR$(219))
  4780.                 END IF
  4781.                 COLOR 12
  4782.                 CALL VerticalLine(y, y + 8, 8, CHR$(219))
  4783.                 CALL VerticalLine(y, y + 8, 9, CHR$(219))
  4784.                 CALL VerticalLine(y, y + 8, 10, CHR$(219))
  4785.                 CALL VerticalLine(y, y + 8, 11, CHR$(219))
  4786.                 CALL VerticalLine(y, y + 8, 12, CHR$(219))
  4787.                 CALL VerticalLine(y, y + 8, 13, CHR$(219))
  4788.                 CALL VerticalLine(y, y + 8, 14, CHR$(219))
  4789.                 COLOR 15, 12
  4790.                 CALL VerticalLine(y + 2, y + 6, 10, CHR$(219))
  4791.                 CALL Plot(11, y + 4, CHR$(219))
  4792.                 CALL VerticalLine(y + 2, y + 6, 12, CHR$(219))
  4793.                 _DELAY movingShipDelay
  4794.                 COLOR 0
  4795.                 CALL VerticalLine(y, y + 8, 8, CHR$(219))
  4796.                 CALL VerticalLine(y, y + 8, 9, CHR$(219))
  4797.                 CALL VerticalLine(y, y + 8, 10, CHR$(219))
  4798.                 CALL VerticalLine(y, y + 8, 11, CHR$(219))
  4799.                 CALL VerticalLine(y, y + 8, 12, CHR$(219))
  4800.                 CALL VerticalLine(y, y + 8, 13, CHR$(219))
  4801.                 CALL VerticalLine(y, y + 8, 14, CHR$(219))
  4802.             NEXT y
  4803.         ELSE
  4804.             a$ = "You already have " + LTRIM$(STR$(shipLog.currentMedSupply)) + " medical kits aboard."
  4805.             b$ = "Because you cannot hold more than 15, you will have"
  4806.             c$ = "to come back here when you have space for these."
  4807.             COLOR 12, 0
  4808.             LOCATE 16, GetCenter(a$)
  4809.             PRINT a$
  4810.             LOCATE 17, GetCenter(b$)
  4811.             PRINT b$
  4812.             LOCATE 18, GetCenter(c$)
  4813.             PRINT c$
  4814.         END IF
  4815.     ELSE
  4816.         COLOR 15, 0
  4817.         a$ = "The people living on this planet regretfully"
  4818.         b$ = "inform you that they cannot help you again"
  4819.         LOCATE 12, GetCenter(a$)
  4820.         PRINT a$
  4821.         LOCATE 13, GetCenter(b$)
  4822.         PRINT b$ + "."
  4823.     END IF
  4824.     anotherEndSub:
  4825.     COLOR 15, 0
  4826.     ClearStatus
  4827.     LOCATE 23, GetCenter("Push -x- to return to the galaxy grid.")
  4828.     COLOR 10, 0
  4829.     PRINT "Push "; CHR$(34);
  4830.     COLOR 14, 0
  4831.     PRINT "R";
  4832.     COLOR 10, 0
  4833.     PRINT CHR$(34); " to ";
  4834.     COLOR 14, 0
  4835.     PRINT "r";
  4836.     COLOR 10, 0
  4837.     PRINT "eturn to the galaxy grid."
  4838.     CALL WaitForCharacter("r")
  4839.     PLAY returnBeep$
  4840.     CLS
  4841.     CALL PrintGrid
  4842.  
  4843.  
  4844.  
« Last Edit: March 18, 2021, 11:28:46 am by Jaze »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #1 on: March 14, 2021, 10:54:10 pm »
Wow that's quite a game! Didn't take me long to find B O O M ;-))

Does your father still code?

@Jaze oh say, I went to save this and... what should we call this? _title "Sarien Sunsets" ?

Put _title "something"  at top and QB64 will suggest that as the File name to save under.
« Last Edit: March 14, 2021, 11:15:20 pm by bplus »

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #2 on: March 18, 2021, 11:30:00 am »
Yeah, he still codes. He likes Visual Basic

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #3 on: March 18, 2021, 11:32:15 am »
Oh yeah, I luv'd it before the .net thing, specially liked the version for DOS.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #4 on: March 18, 2021, 11:36:03 am »
I get rather nostalgic about DOS. My first PC was an IBM compatible 386sx at a whopping 15 megahertz. DOS came with qbasic and I wrote hundreds of extra levels for nibbles.bas

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #5 on: March 18, 2021, 11:46:52 am »
Yeah, really tight relationship between Basic and DOS, back in days when you owned your computer and knew 99% of what was on it. Now I think <1% ;(

But! I would NOT trade what you can do today with yesterday! With QB64 you can do so much more than before!
« Last Edit: March 18, 2021, 12:01:50 pm by bplus »

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: I wanted to do something with strings... so I did
« Reply #6 on: March 18, 2021, 01:15:49 pm »
by the way, if you change the t$ constant the game will make most of the graphics out of that character. but if you try to use more than a single character the game will shoot out errors everywhere