Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Qwerkey

Pages: 1 [2] 3 4 ... 8
16
Games / Tic Tac Toe Rings by Fellippe Heitor
« on: May 24, 2020, 05:40:12 am »
Tic Tac Toe Rings

Author: @FellippeHeitor
Source: qb64.org Forum
URL: https://www.qb64.org/forum/index.php?topic=2368.0
Version: 1
Tags: [Graphics], [Skill], [Addictive]

Description:
I recently found the game Rings by a studio called Gamezaur. This is my attempt at recreating it.

I won't elaborate on the gameplay here. Keep the concept of "Tic Tac Toe" in mind - except it's single-player mode - and you should master it in no time.


Code: QB64: [Select]
  1.  
  2. $EXEICON:'./assets/images/tttr.ico'
  3.  
  4. $VERSIONINFO:FILEVERSION#=1,0,0,0
  5. $VERSIONINFO:PRODUCTVERSION#=1,0,0,0
  6. $VERSIONINFO:CompanyName=Fellippe Heitor
  7. $VERSIONINFO:ProductName=Tic Tac Toe Ring
  8. $VERSIONINFO:ProductVersion=1.0
  9. $VERSIONINFO:Comments=Based on 'Rings.' by Gamezaur; Created with QB64.
  10. $VERSIONINFO:Web=https://github.com/FellippeHeitor/TicTacToeRing
  11. $VERSIONINFO:InternalName=tictactoering.bas
  12.  
  13. CONST true = -1, false = 0
  14.  
  15. 'Required shared variables for printLarge
  16. DIM SHARED charSet(255, 1 TO 16, 1 TO 8) AS _BYTE
  17.  
  18. initializeCharSetPrintLarge
  19.  
  20. TYPE object
  21.     x AS SINGLE
  22.     y AS SINGLE
  23.     xv AS SINGLE
  24.     yv AS SINGLE
  25.     xa AS SINGLE
  26.     ya AS SINGLE
  27.     set AS STRING * 6
  28.     size AS SINGLE
  29.     start AS SINGLE
  30.     duration AS SINGLE
  31.     state AS _BYTE
  32.     text AS INTEGER
  33.     w AS INTEGER
  34.     h AS INTEGER
  35.     r AS INTEGER
  36.     g AS INTEGER
  37.     b AS INTEGER
  38.  
  39. DIM canvas AS LONG
  40. canvas = _NEWIMAGE(600, 600, 32)
  41.  
  42. SCREEN canvas
  43. _TITLE "Tic Tac Toe Ring"
  44.  
  45. DIM peg(0 TO 12) AS object
  46. DIM del(1 TO 9) AS object
  47.  
  48. DIM emptySet$
  49. emptySet$ = MKI$(-1) + MKI$(-1) + MKI$(-1)
  50. peg(0).set = emptySet$
  51.  
  52. 'set pegs positions
  53. DIM spacing AS INTEGER
  54. setPegs
  55.  
  56. 'set combo messages
  57. DIM megaComboMsg$(1 TO 6)
  58. setComboMessages
  59.  
  60. setRingColors
  61.  
  62. DIM circleImage(1 TO i, 1 TO 3) AS LONG
  63. generateRingImages
  64.  
  65. DIM crownIcon AS LONG
  66. generateCrownIcon
  67.  
  68. DIM bg AS LONG, bgWithoutShelf AS LONG
  69. generateBG
  70.  
  71. 'flash warning
  72. _PUTIMAGE (0, 0), bg
  73. centerLarge (_HEIGHT / 2) - fontHeightLarge(2) / 2, "This game contains bright,", 2
  74. centerLarge (_HEIGHT / 2) + fontHeightLarge(2) / 2, "rapidly flashing colors.", 2
  75.  
  76. DIM music AS _BYTE, sfx AS _BYTE
  77. music = true
  78. sfx = true
  79.  
  80. loadGame
  81.  
  82. 'load sounds
  83. j = TIMER
  84. DIM selectSound AS LONG
  85. selectSound = _SNDOPEN("assets/sounds/select.ogg")
  86. IF selectSound > 0 THEN _SNDVOL selectSound, .3
  87.  
  88. DIM wooshSound AS LONG
  89. wooshSound = _SNDOPEN("assets/sounds/woosh.ogg")
  90. IF wooshSound > 0 THEN _SNDVOL wooshSound, .5
  91.  
  92. DIM woodblock AS LONG
  93. woodblock = _SNDOPEN("assets/sounds/woodblock.wav")
  94.  
  95. DIM track(1 TO 1) AS LONG, mainTrackVolume AS SINGLE
  96. track(1) = _SNDOPEN("assets/music/track1.ogg")
  97. mainTrackVolume = 1
  98. IF track(1) > 0 THEN _SNDVOL track(1), mainTrackVolume
  99.  
  100. DIM comboSound(1 TO 8) AS LONG, a$
  101. RESTORE comboSoundFiles
  102. FOR i = 1 TO 8
  103.     READ a$
  104.     comboSound(i) = _SNDOPEN("assets/sounds/" + a$)
  105.  
  106. comboSoundFiles:
  107. DATA do.ogg,re.ogg,mi.ogg,fa.ogg,sol.ogg,la.ogg,si.ogg,do2.ogg
  108.  
  109. 'if loading sounds took more than 2 seconds, no need to pause
  110. j = TIMER - j
  111. IF j < 2 THEN pause 2 - j
  112.  
  113. DIM thisColor AS INTEGER
  114. doIntro
  115.  
  116.  
  117. 'add divs to bg
  118. bgWithoutShelf = _COPYIMAGE(bg)
  119. LINE (_WIDTH / 2 - (_WIDTH / spacing) * 2, _HEIGHT / 2 - (_HEIGHT / spacing) * 2)-STEP(_WIDTH / spacing * 4, _HEIGHT / spacing * 4), _RGB32(0, 50), BF
  120. LINE (3 + peg(10).x - (_WIDTH / spacing / 2), 3 + peg(10).y - (_WIDTH / spacing / 2))-(3 + peg(12).x + (_WIDTH / spacing / 2), 3 + peg(12).y + (_WIDTH / spacing / 2)), _RGB32(255, 15), BF
  121. LINE (peg(10).x - (_WIDTH / spacing / 2), peg(10).y - (_WIDTH / spacing / 2))-(peg(12).x + (_WIDTH / spacing / 2), peg(12).y + (_WIDTH / spacing / 2)), _RGB32(255, 15), BF
  122.  
  123. 'game
  124. DIM score AS _UNSIGNED LONG, visibleScore AS _UNSIGNED LONG
  125. DIM highscore AS _UNSIGNED LONG, visibleHighScore AS _UNSIGNED LONG
  126. DIM level AS _UNSIGNED LONG, maxColors AS INTEGER
  127. DIM animation(0 TO 8) AS object, gameOver AS _BYTE
  128. DIM particle(5000) AS object, pauseGame AS _BYTE
  129.  
  130. animation(0).duration = .25 'board flash
  131. FOR i = 1 TO 5
  132.     animation(i).duration = .5 'matches
  133. animation(6).duration = 1 'new set spawn
  134. animation(7).duration = 1 'combo info
  135.  
  136. DIM multiplier AS INTEGER
  137. multiplier = 1
  138.  
  139. visibleScore = score
  140. visibleHighScore = highscore
  141.  
  142. DIM button(100) AS object
  143. DIM caption(100) AS STRING
  144. DIM totalButtons AS INTEGER
  145. DIM currentButton AS INTEGER
  146.  
  147.     DO 'main game loop
  148.         'read mouse data
  149.         WHILE _MOUSEINPUT: WEND
  150.  
  151.         'read keyboard
  152.         DIM keyb AS LONG
  153.         keyb = _KEYHIT
  154.  
  155.         IF mainTrackVolume > .5 AND music THEN
  156.             mainTrackVolume = mainTrackVolume - .05
  157.             IF track(1) > 0 THEN _SNDVOL track(1), mainTrackVolume
  158.         END IF
  159.         'redraw board
  160.         _DONTBLEND
  161.         _PUTIMAGE (0, 0), bg
  162.         _BLEND
  163.  
  164.         'print osd
  165.         DIM enterSettings AS _BYTE
  166.         createMainScreenButtons
  167.         IF ABS(keyb) <> 27 AND pauseGame = false AND enterSettings = false THEN doButtons
  168.  
  169.         _PUTIMAGE (25, 28), crownIcon
  170.         COLOR _RGB32(200)
  171.         _PRINTSTRING (52, 28), STR$(visibleHighScore)
  172.  
  173.         COLOR _RGB32(255)
  174.         printLarge 0, 45, STR$(visibleScore), 6
  175.  
  176.         IF multiplier > 1 THEN
  177.             _PRINTSTRING (52, 132), "x" + LTRIM$(STR$(multiplier))
  178.         END IF
  179.  
  180.         drawPegs
  181.         generateNewSets
  182.  
  183.         IF ABS(keyb) <> 27 AND pauseGame = false AND enterSettings = false THEN checkButtons
  184.  
  185.         DIM prevbt AS INTEGER
  186.         IF currentButton <> prevbt THEN
  187.             IF currentButton > 0 AND sfx AND selectSound > 0 THEN _SNDPLAYCOPY selectSound
  188.             prevbt = currentButton
  189.         END IF
  190.  
  191.         IF _MOUSEBUTTON(1) THEN
  192.             'drag?
  193.             DIM dragging AS INTEGER
  194.             DIM mouseDown AS _BYTE
  195.             IF NOT mouseDown THEN
  196.                 'are we beginning to drag a ring or set of rings?
  197.                 dragging = 0
  198.                 FOR i = 10 TO 12
  199.                     IF dist(peg(i).x, peg(i).y, _MOUSEX, _MOUSEY) <= 40 AND peg(i).set <> emptySet$ THEN
  200.                         dragging = i
  201.                         EXIT FOR
  202.                     END IF
  203.                 NEXT
  204.  
  205.                 mouseDown = true
  206.             END IF
  207.         ELSE
  208.             IF mouseDown THEN
  209.                 IF dragging = 0 THEN
  210.                     IF enterSettings = false AND currentButton = 1 THEN
  211.                         enterSettings = true
  212.                         _CONTINUE
  213.                     END IF
  214.  
  215.                     IF pauseGame = false AND currentButton = 2 THEN 'pause
  216.                         pauseGame = true
  217.                         _CONTINUE
  218.                     END IF
  219.                 END IF
  220.  
  221.                 'place rings
  222.                 DIM placed AS _BYTE
  223.                 placed = false
  224.  
  225.                 IF dragging THEN
  226.                     FOR i = 1 TO 9
  227.                         IF dist(peg(i).x, peg(i).y, _MOUSEX, _MOUSEY) <= 40 THEN
  228.                             'check that the chosen peg can hold the current set of rings
  229.                             placed = true
  230.                             FOR j = 1 TO 3
  231.                                 IF CVI(MID$(peg(dragging).set, j * 2 - 1, 2)) > 0 AND CVI(MID$(peg(i).set, j * 2 - 1, 2)) > 0 THEN
  232.                                     placed = false
  233.                                     EXIT FOR
  234.                                 END IF
  235.                             NEXT
  236.                             IF placed THEN
  237.                                 IF woodblock > 0 AND sfx THEN _SNDPLAYCOPY woodblock
  238.                                 FOR j = 1 TO 3
  239.                                     IF CVI(MID$(peg(dragging).set, j * 2 - 1, 2)) > 0 THEN
  240.                                         MID$(peg(i).set, j * 2 - 1, 2) = MID$(peg(dragging).set, j * 2 - 1, 2)
  241.                                     END IF
  242.                                 NEXT
  243.                                 peg(dragging).set = emptySet$
  244.                                 EXIT FOR
  245.                             ELSE
  246.                                 EXIT FOR
  247.                             END IF
  248.                         END IF
  249.                     NEXT
  250.                 END IF
  251.  
  252.                 FOR j = 1 TO 9
  253.                     'prepare backup copies for deletion tagging
  254.                     del(j) = peg(j)
  255.                 NEXT
  256.  
  257.                 'check matches
  258.                 DIM r(1 TO 3) AS INTEGER, previousScore AS _UNSIGNED LONG
  259.                 DIM s$, found1 AS INTEGER, found2 AS INTEGER, scored AS _BYTE
  260.                 DIM totalMatches AS INTEGER
  261.                 totalMatches = 0
  262.                 previousScore = score
  263.                 IF placed THEN
  264.                     'look for 3 same-color rings on peg(i) --> ((o))
  265.                     FOR j = 1 TO 3
  266.                         r(j) = CVI(MID$(peg(i).set, j * 2 - 1, 2))
  267.                     NEXT
  268.                     IF r(1) = r(2) AND r(2) = r(3) THEN
  269.                         score = score + 3 * multiplier
  270.                         animation(0).start = TIMER
  271.                         animation(5).start = TIMER
  272.                         animation(5).x = peg(i).x
  273.                         animation(5).y = peg(i).y
  274.                         animation(5).r = _RED32(c(r(1)))
  275.                         animation(5).g = _GREEN32(c(r(1)))
  276.                         animation(5).b = _BLUE32(c(r(1)))
  277.                         animation(8).r = _RED32(c(r(1)))
  278.                         animation(8).g = _GREEN32(c(r(1)))
  279.                         animation(8).b = _BLUE32(c(r(1)))
  280.                         del(i).set = emptySet$
  281.                         addParticles peg(i).x, peg(i).y, 70, c(r(1))
  282.                         addParticles peg(i).x, peg(i).y, 30, _RGB32(_RED32(c(r(1))) + 30, _GREEN32(c(r(1))) + 30, _BLUE32(c(r(1))) + 30)
  283.                         totalMatches = totalMatches + 1
  284.                     END IF
  285.  
  286.                     'look for line matches |, -, /, \
  287.                     DIM m AS INTEGER, checks AS INTEGER
  288.                     DIM nextPeg(0 TO 2) AS INTEGER
  289.                     FOR m = 1 TO 4
  290.                         SELECT CASE m
  291.                             CASE 1 'across
  292.                                 checks = 3
  293.                                 r(1) = 1
  294.                                 r(2) = 4
  295.                                 r(3) = 7
  296.                                 nextPeg(1) = 1
  297.                                 nextPeg(2) = 2
  298.                             CASE 2 'down
  299.                                 checks = 3
  300.                                 r(1) = 1
  301.                                 r(2) = 2
  302.                                 r(3) = 3
  303.                                 nextPeg(1) = 3
  304.                                 nextPeg(2) = 6
  305.                             CASE 3 'diagonal \
  306.                                 checks = 1
  307.                                 r(1) = 1
  308.                                 nextPeg(1) = 4
  309.                                 nextPeg(2) = 8
  310.                             CASE 4 'diagonal /
  311.                                 checks = 1
  312.                                 r(1) = 3
  313.                                 nextPeg(1) = 2
  314.                                 nextPeg(2) = 4
  315.                         END SELECT
  316.  
  317.                         FOR i = 1 TO checks
  318.                             'look at each ring on the first peg of each row
  319.                             FOR j = 1 TO 3
  320.                                 scored = false
  321.                                 s$ = MID$(peg(r(i)).set, j * 2 - 1, 2)
  322.                                 IF s$ = MKI$(-1) THEN _CONTINUE
  323.                                 found1 = INSTR(peg(r(i) + nextPeg(1)).set, s$)
  324.                                 found2 = INSTR(peg(r(i) + nextPeg(2)).set, s$)
  325.                                 IF found1 > 0 AND found2 > 0 THEN
  326.                                     'match! clear all rings of the same color in this group of pegs
  327.                                     FOR k = 0 TO 2
  328.                                         found1 = INSTR(del(r(i) + nextPeg(k)).set, s$)
  329.                                         DO WHILE found1
  330.                                             MID$(del(r(i) + nextPeg(k)).set, found1, 2) = MKI$(-1)
  331.                                             addParticles del(r(i) + nextPeg(k)).x, del(r(i) + nextPeg(k)).y, 23, c(CVI(s$))
  332.                                             addParticles del(r(i) + nextPeg(k)).x, del(r(i) + nextPeg(k)).y, 10, _RGB32(_RED32(c(CVI(s$))) + 30, _GREEN32(c(CVI(s$))) + 30, _BLUE32(c(CVI(s$))) + 30)
  333.                                             score = score + multiplier
  334.                                             found1 = INSTR(del(r(i) + nextPeg(k)).set, s$)
  335.                                         LOOP
  336.                                     NEXT
  337.                                     scored = true
  338.                                     totalMatches = totalMatches + 1
  339.                                     animation(0).start = TIMER
  340.                                     animation(m).start = TIMER
  341.                                     animation(m).x = peg(r(i)).x
  342.                                     animation(m).y = peg(r(i)).y
  343.                                     animation(m).r = _RED32(c(CVI(s$)))
  344.                                     animation(m).g = _GREEN32(c(CVI(s$)))
  345.                                     animation(m).b = _BLUE32(c(CVI(s$)))
  346.                                     animation(8).r = _RED32(c(CVI(s$)))
  347.                                     animation(8).g = _GREEN32(c(CVI(s$)))
  348.                                     animation(8).b = _BLUE32(c(CVI(s$)))
  349.                                 END IF
  350.  
  351.                                 IF scored THEN MID$(del(r(i)).set, j * 2 - 1, 2) = MKI$(-1)
  352.                             NEXT
  353.                         NEXT
  354.                     NEXT
  355.  
  356.                     FOR j = 1 TO 9
  357.                         'perform deletion, if any items were marked = MKI$(-1)
  358.                         peg(j) = del(j)
  359.                     NEXT
  360.  
  361.                     IF previousScore < score THEN
  362.                         IF wooshSound > 0 AND sfx THEN _SNDPLAYCOPY wooshSound
  363.  
  364.                         multiplier = multiplier + 1
  365.  
  366.                         IF sfx THEN
  367.                             IF multiplier - 1 <= UBOUND(combosound) THEN
  368.                                 IF comboSound(multiplier - 1) > 0 THEN
  369.                                     _SNDPLAYCOPY comboSound(multiplier - 1)
  370.                                 END IF
  371.                             ELSE
  372.                                 IF comboSound(UBOUND(combosound)) > 0 THEN
  373.                                     _SNDPLAYCOPY comboSound(UBOUND(combosound))
  374.                                 END IF
  375.                             END IF
  376.                         END IF
  377.  
  378.                         DIM m$(1 TO 2)
  379.                         m$(1) = megaComboMsg$(_CEIL(RND * UBOUND(megaComboMsg$)))
  380.                         m$(2) = LTRIM$(STR$(multiplier)) + "x combo!"
  381.                         animation(7).start = TIMER
  382.                         animation(8).start = TIMER
  383.                         animation(8).x = _MOUSEX
  384.                         animation(8).y = _MOUSEY
  385.                         animation(8).xa = score - previousScore
  386.                         animation(8).ya = dist(_MOUSEX, _MOUSEY, printWidthLarge(STR$(visibleScore), 6) / 2, 45)
  387.                         animation(8).duration = 5
  388.                     ELSE
  389.                         multiplier = 1
  390.                     END IF
  391.                     IF score > highscore THEN highscore = score
  392.                 END IF
  393.             END IF
  394.             mouseDown = false
  395.             dragging = 0
  396.         END IF
  397.  
  398.         hoverHighlight
  399.         checkAvailableMoves
  400.         drawRings
  401.         doAnimations
  402.         updateScore
  403.         updateParticles
  404.  
  405.         'update display
  406.         _DISPLAY
  407.  
  408.         IF enterSettings THEN
  409.             addParticles _MOUSEX, _MOUSEY, 30, _RGB32(255)
  410.             addParticles _MOUSEX, _MOUSEY, 30, _RGB32(67, 172, 183)
  411.             settingsScreen
  412.             enterSettings = false
  413.         END IF
  414.  
  415.         IF pauseGame THEN
  416.             addParticles _MOUSEX, _MOUSEY, 30, _RGB32(255)
  417.             addParticles _MOUSEX, _MOUSEY, 30, _RGB32(67, 172, 183)
  418.             keyb = -27
  419.             pauseGame = false
  420.         END IF
  421.  
  422.         'limit fps
  423.         _LIMIT 60
  424.  
  425.         DIM userQuit AS _BYTE
  426.         userQuit = _EXIT
  427.         IF keyb = -27 THEN EXIT DO
  428.     LOOP UNTIL gameOver OR userQuit
  429.  
  430.     saveGame
  431.  
  432.     IF userQuit THEN SYSTEM
  433.  
  434.     endScreen
  435.  
  436.  
  437. SUB setPegs
  438.     SHARED spacing AS INTEGER
  439.     SHARED peg() AS object
  440.     SHARED emptySet$
  441.  
  442.     DIM l AS SINGLE, i AS INTEGER, j AS SINGLE, k AS SINGLE
  443.     spacing = 6
  444.     l = -(_HEIGHT / spacing)
  445.     FOR i = 1 TO 12
  446.         j = j + 1
  447.         IF j > 3 THEN j = 1: l = l + (_HEIGHT / spacing)
  448.         SELECT CASE j
  449.             CASE 1: k = -_WIDTH / spacing
  450.             CASE 2: k = 0
  451.             CASE 3: k = _WIDTH / spacing
  452.         END SELECT
  453.         peg(i).x = _WIDTH / 2 + k
  454.         peg(i).y = _HEIGHT / 2 + l
  455.         peg(i).set = emptySet$
  456.     NEXT
  457.  
  458. SUB setComboMessages
  459.     SHARED megaComboMsg$()
  460.     DIM i AS INTEGER
  461.  
  462.     RESTORE megaComboMsgs
  463.     FOR i = 1 TO UBOUND(megaComboMsg$)
  464.         READ megaComboMsg$(i)
  465.     NEXT
  466.     megaComboMsgs:
  467.     DATA Fantastic,Outstanding,Amazing,Awesome,MEGA,SUPER
  468.  
  469. SUB setRingColors
  470.     SHARED i AS INTEGER
  471.  
  472.     i = i + 1: c(i) = _RGB32(0, 78, 249) 'blue
  473.     i = i + 1: c(i) = _RGB32(0, 100, 0) 'green
  474.     i = i + 1: c(i) = _RGB32(222, 61, 44) 'red
  475.     i = i + 1: c(i) = _RGB32(216, 216, 44) 'yellow
  476.     i = i + 1: c(i) = _RGB32(233, 139, 17) 'orange
  477.     i = i + 1: c(i) = _RGB32(222, 105, 161) 'pink
  478.     i = i + 1: c(i) = _RGB32(139, 11, 205) 'purple
  479.     i = i + 1: c(i) = _RGB32(55, 211, 211) 'cyan
  480.     i = i + 1: c(i) = _RGB32(255, 255, 255) 'white
  481.     i = i + 1: c(i) = _RGB32(100, 100, 100) 'dark gray
  482.  
  483. SUB generateRingImages
  484.     DIM j AS INTEGER, k AS INTEGER
  485.     SHARED circleImage() AS LONG
  486.  
  487.     FOR j = 1 TO UBOUND(c)
  488.         FOR k = 1 TO 3
  489.             circleImage(j, k) = _NEWIMAGE(k * 29, k * 29, 32)
  490.             _DEST circleImage(j, k)
  491.             PAINT (0, 0), _RGB32(255, 0, 255)
  492.             CircleFill _WIDTH / 2, _HEIGHT / 2, k * 14, c(j)
  493.             CircleFill _WIDTH / 2, _HEIGHT / 2, k * (8 + k), _RGB32(255, 0, 255)
  494.             _CLEARCOLOR _RGB32(255, 0, 255)
  495.         NEXT
  496.     NEXT
  497.  
  498. SUB generateCrownIcon
  499.     SHARED crownIcon AS LONG
  500.     DIM i AS INTEGER, j AS INTEGER
  501.     DIM px AS INTEGER
  502.  
  503.     RESTORE crownIconData
  504.     crownIcon = _NEWIMAGE(24, 14, 32)
  505.     _DEST crownIcon
  506.     FOR i = 0 TO 13
  507.         FOR j = 0 TO 23
  508.             READ px
  509.             SELECT CASE px
  510.                 CASE 1
  511.                     PSET (j, i), _RGB32(0)
  512.                 CASE 2
  513.                     PSET (j, i), _RGB32(205, 161, 0)
  514.             END SELECT
  515.         NEXT
  516.     NEXT
  517.  
  518.     crownIconData:
  519.     DATA 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0
  520.     DATA 0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0
  521.     DATA 0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0
  522.     DATA 0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0
  523.     DATA 1,2,2,1,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,1,2,2,1
  524.     DATA 1,2,2,1,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,1,2,2,1
  525.     DATA 0,1,1,2,1,1,0,0,0,1,2,2,2,2,1,0,0,0,1,1,2,1,1,0
  526.     DATA 0,0,1,2,2,2,1,1,0,1,2,2,2,2,1,0,1,1,2,2,2,1,0,0
  527.     DATA 0,0,1,2,2,2,2,2,1,2,2,2,2,2,2,1,2,2,2,2,2,1,0,0
  528.     DATA 0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0
  529.     DATA 0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0
  530.     DATA 0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0
  531.     DATA 0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0
  532.     DATA 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0
  533.  
  534. SUB generateBG
  535.     SHARED bg AS LONG
  536.     DIM i AS SINGLE
  537.  
  538.     bg = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  539.     _DEST bg
  540.     FOR i = 0 TO _HEIGHT - 1 STEP _HEIGHT / 60
  541.         LINE (0, 0)-(_WIDTH - 1, i), _RGB32(139, 116, 177, 5), BF
  542.     NEXT
  543.  
  544. SUB doIntro
  545.     SHARED thisColor AS INTEGER
  546.     SHARED circleImage() AS LONG
  547.     SHARED track() AS LONG
  548.     SHARED bg AS LONG
  549.     SHARED music AS _BYTE
  550.  
  551.     DIM x AS SINGLE, y AS SINGLE, j AS INTEGER
  552.     DIM introRings(1 TO 30) AS object
  553.     DIM i AS INTEGER
  554.  
  555.     FOR i = 1 TO UBOUND(introRings)
  556.         introRings(i).xa = RND * _PI(2)
  557.         introRings(i).xv = RND * 5
  558.         introRings(i).r = RND * 30 + 50
  559.         introRings(i).set = MKI$(-1) + MKI$(-1) + MKI$(_CEIL(RND * UBOUND(c)))
  560.     NEXT
  561.  
  562.     addParticles _WIDTH / 2, _HEIGHT / 2, 5000, _RGB32(255)
  563.  
  564.     DIM introTimer AS SINGLE
  565.     introTimer = TIMER
  566.     IF track(1) > 0 AND music THEN _SNDLOOP track(1)
  567.     DO
  568.         _DONTBLEND
  569.         _PUTIMAGE (0, 0), bg
  570.         _BLEND
  571.  
  572.         FOR i = 1 TO UBOUND(introRings)
  573.             introRings(i).xa = introRings(i).xa + .01
  574.             introRings(i).r = introRings(i).r + introRings(i).xv
  575.             x = _WIDTH / 2 + COS(introRings(i).xa) * introRings(i).r
  576.             y = _HEIGHT / 2 + SIN(introRings(i).xa) * introRings(i).r
  577.  
  578.             FOR j = 1 TO 3
  579.                 thisColor = CVI(MID$(introRings(i).set, j * 2 - 1, 2))
  580.                 IF thisColor > 0 THEN
  581.                     _PUTIMAGE (x - (_WIDTH(circleImage(thisColor, j)) / 2), y - (_HEIGHT(circleImage(thisColor, j)) / 2)), circleImage(thisColor, j)
  582.                 END IF
  583.             NEXT
  584.         NEXT
  585.  
  586.         updateParticles
  587.  
  588.         LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - introTimer, 4, 6, 0, 255)), BF
  589.  
  590.         COLOR _RGB32(0)
  591.         centerLarge (_HEIGHT / 2) - fontHeightLarge(2) + 3, "Tic Tac Toe", 2
  592.         centerLarge (_HEIGHT / 2) + 3, "Rings", 7
  593.         centerLarge _HEIGHT - fontHeightLarge(2) + 3, "Fellippe Heitor, 2020", 1
  594.  
  595.         COLOR _RGB32(255)
  596.         centerLarge (_HEIGHT / 2) - fontHeightLarge(2), "Tic Tac Toe", 2
  597.         centerLarge (_HEIGHT / 2), "Rings", 7
  598.         centerLarge _HEIGHT - fontHeightLarge(2), "Fellippe Heitor, 2020", 1
  599.  
  600.         LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - introTimer, 0, 1.5, 255, 0)), BF
  601.         LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - introTimer, 4, 5, 0, 255)), BF
  602.         LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(0, map(TIMER - introTimer, 5, 6, 0, 255)), BF
  603.  
  604.         WHILE _MOUSEINPUT: WEND
  605.         _DISPLAY
  606.         _LIMIT 60
  607.     LOOP UNTIL TIMER - introTimer > 6 OR _KEYHIT OR _MOUSEBUTTON(1)
  608.  
  609.  
  610. SUB drawPegs
  611.     SHARED peg() AS object
  612.  
  613.     DIM i AS INTEGER
  614.     FOR i = 1 TO 9
  615.         CircleFill peg(i).x, peg(i).y, 3, _RGB32(255)
  616.     NEXT
  617.  
  618. SUB generateNewSets
  619.     SHARED peg() AS object
  620.     SHARED animation() AS object
  621.     SHARED emptySet$
  622.     SHARED level AS _UNSIGNED LONG, maxColors AS INTEGER
  623.  
  624.     DIM i AS INTEGER
  625.     DIM j AS INTEGER
  626.  
  627.     'new sets must be generated according to
  628.     'current board's available positions
  629.     IF peg(10).set + peg(11).set + peg(12).set = emptySet$ + emptySet$ + emptySet$ THEN
  630.         level = level + 1
  631.         maxColors = map(level, 1, 60, 3, UBOUND(c)) 'as level goes up, add more colors
  632.         IF maxColors < 3 THEN maxColors = 3
  633.         IF maxColors > UBOUND(c) THEN maxColors = UBOUND(c)
  634.  
  635.         DIM pegsUsed AS STRING, thisPeg AS INTEGER, newPeg AS INTEGER
  636.         pegsUsed = ""
  637.         FOR i = 10 TO 12
  638.             'reset this peg
  639.             peg(i).set = emptySet$
  640.  
  641.             'choose an existing peg randomly
  642.             newPeg = _CEIL(RND * 9)
  643.             thisPeg = newPeg
  644.             DO
  645.                 IF INSTR(peg(thisPeg).set, MKI$(-1)) > 0 AND INSTR(pegsUsed, MKI$(thisPeg)) = 0 THEN
  646.                     'found a peg with an empty slot or more
  647.                     EXIT DO
  648.                 END IF
  649.                 thisPeg = thisPeg + 1
  650.                 IF thisPeg > 9 THEN thisPeg = 1
  651.                 IF thisPeg = newPeg THEN
  652.                     'full circle
  653.                     thisPeg = 0
  654.                     EXIT DO
  655.                 END IF
  656.             LOOP
  657.  
  658.             'store the chosen peg's id
  659.             IF thisPeg > 0 THEN pegsUsed = pegsUsed + MKI$(thisPeg)
  660.  
  661.             'generate a set, with random colors
  662.             DO
  663.                 FOR j = 1 TO 3
  664.                     IF MID$(peg(thisPeg).set, j * 2 - 1, 2) = MKI$(-1) THEN
  665.                         IF RND * 100 < 30 THEN
  666.                             MID$(peg(i).set, j * 2 - 1, 2) = MKI$(_CEIL(RND * maxColors))
  667.                         END IF
  668.                     END IF
  669.                 NEXT
  670.             LOOP WHILE peg(i).set = emptySet$ 'can't be empty
  671.             IF INSTR(peg(i).set, MKI$(-1)) = 0 THEN 'can't be full
  672.                 j = _CEIL(RND * 3)
  673.                 MID$(peg(i).set, j * 2 - 1, 2) = MKI$(-1)
  674.             END IF
  675.         NEXT
  676.         animation(6).start = TIMER
  677.     END IF
  678.  
  679. SUB doAnimations
  680.     DIM i AS INTEGER, j AS SINGLE, k AS SINGLE, l AS SINGLE
  681.     SHARED animation() AS object
  682.     SHARED peg() AS object
  683.     SHARED totalMatches AS INTEGER
  684.     SHARED m$(), spacing AS INTEGER
  685.     SHARED visibleScore AS _UNSIGNED LONG
  686.  
  687.     FOR i = 0 TO UBOUND(animation)
  688.         IF TIMER - animation(i).start <= animation(i).duration THEN
  689.             DIM animSize AS SINGLE
  690.             animSize = map(TIMER - animation(i).start, 0, animation(i).duration, 50, 0)
  691.             SELECT CASE i
  692.                 CASE 0 'board flash
  693.                     LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - animation(i).start, 0, animation(i).duration, 100, 0)), BF
  694.                 CASE 1 'across
  695.                     FOR j = 0 TO _WIDTH STEP _WIDTH / 30
  696.                         FOR k = 1 TO animSize STEP 5
  697.                             CircleFill j, animation(i).y, k, _RGB32(animation(i).r, animation(i).g, animation(i).b, 20)
  698.                         NEXT
  699.                     NEXT
  700.                 CASE 2 'down
  701.                     FOR j = 0 TO _WIDTH STEP _WIDTH / 30
  702.                         FOR k = 1 TO animSize STEP 5
  703.                             CircleFill animation(i).x, j, k, _RGB32(animation(i).r, animation(i).g, animation(i).b, 20)
  704.                         NEXT
  705.                     NEXT
  706.                 CASE 3 'diagonal \
  707.                     FOR j = 0 TO _WIDTH STEP _WIDTH / 30
  708.                         FOR k = 1 TO animSize STEP 5
  709.                             CircleFill j, j, k, _RGB32(animation(i).r, animation(i).g, animation(i).b, 20)
  710.                         NEXT
  711.                     NEXT
  712.                 CASE 4 'diagonal /
  713.                     FOR j = 0 TO _WIDTH STEP _WIDTH / 30
  714.                         FOR k = 1 TO animSize STEP 5
  715.                             CircleFill j, _HEIGHT - j, k, _RGB32(animation(i).r, animation(i).g, animation(i).b, 20)
  716.                         NEXT
  717.                     NEXT
  718.                 CASE 5 'single peg ((o))
  719.                     FOR k = 1 TO animSize * 2
  720.                         CircleFill animation(i).x, animation(i).y, k, _RGB32(animation(i).r, animation(i).g, animation(i).b, 20)
  721.                     NEXT
  722.                 CASE 6 'new peg set
  723.                     FOR k = 10 TO 12
  724.                         CIRCLE (peg(k).x, peg(k).y), animSize * 1.5, _RGB32(255, animSize / 2)
  725.                         CIRCLE (peg(k).x, peg(k).y), animSize, _RGB32(255, animSize)
  726.                     NEXT
  727.                 CASE 7 'combo info
  728.                     k = INT(map(animSize, 50, 40, 1, 4))
  729.                     IF k < 1 THEN k = 1
  730.                     IF k > 4 THEN k = 4
  731.                     COLOR _RGB32(0, 80)
  732.                     FOR l = -4 TO 4 STEP 8
  733.                         IF totalMatches > 1 THEN
  734.                             printLarge (l + _WIDTH - printWidthLarge(m$(1), k)) / 2, (l + _HEIGHT - fontHeightLarge(k)) / 2 - fontHeightLarge(k), m$(1), k
  735.                         END IF
  736.                         printLarge (l + _WIDTH - printWidthLarge(m$(2), k)) / 2, (l + _HEIGHT - fontHeightLarge(k)) / 2, m$(2), k
  737.                     NEXT
  738.                     COLOR _RGB32(255)
  739.                     IF totalMatches > 1 THEN
  740.                         printLarge (_WIDTH - printWidthLarge(m$(1), k)) / 2, (_HEIGHT - fontHeightLarge(k)) / 2 - fontHeightLarge(k), m$(1), k
  741.                     END IF
  742.                     printLarge (_WIDTH - printWidthLarge(m$(2), k)) / 2, (_HEIGHT - fontHeightLarge(k)) / 2, m$(2), k
  743.                 CASE 8 'score increase
  744.                     DIM a AS SINGLE
  745.                     animation(8).x = lerp(animation(8).x, printWidthLarge(STR$(visibleScore), 6) / 2, .06)
  746.                     animation(8).y = lerp(animation(8).y, 45, .06)
  747.                     a = dist(animation(8).x, animation(8).y, printWidthLarge(STR$(visibleScore), 6) / 2, 45)
  748.                     IF a <= 30 THEN
  749.                         animation(8).start = 0
  750.                     END IF
  751.                     a = map(a, 0, animation(8).ya, 0, 1024)
  752.                     COLOR _RGB32(animation(8).r, animation(8).g, animation(8).b, a)
  753.                     printLarge 2 + animation(8).x, 2 + animation(8).y, LTRIM$(STR$(animation(8).xa)), 4
  754.                     COLOR _RGB32(255, a)
  755.                     printLarge animation(8).x, animation(8).y, LTRIM$(STR$(animation(8).xa)), 4
  756.             END SELECT
  757.         END IF
  758.     NEXT
  759.  
  760. SUB saveGame
  761.     SHARED score AS _UNSIGNED LONG, highscore AS _UNSIGNED LONG
  762.     SHARED level AS _UNSIGNED LONG
  763.     SHARED gameOver AS _BYTE
  764.     SHARED peg() AS object
  765.     SHARED music AS _BYTE, sfx AS _BYTE
  766.  
  767.     DIM i AS INTEGER
  768.  
  769.     OPEN "tictactoering.dat" FOR BINARY AS #1
  770.     DIM signature AS STRING
  771.     signature = "tttring"
  772.     PUT #1, 1, signature
  773.     PUT #1, , music
  774.     PUT #1, , sfx
  775.     PUT #1, , score
  776.     PUT #1, , highscore
  777.     PUT #1, , level
  778.     PUT #1, , gameOver
  779.     FOR i = 1 TO 12
  780.         PUT #1, , peg(i)
  781.     NEXT
  782.     CLOSE #1
  783.  
  784. SUB loadGame
  785.     SHARED score AS _UNSIGNED LONG, highscore AS _UNSIGNED LONG
  786.     SHARED level AS _UNSIGNED LONG
  787.     SHARED gameOver AS _BYTE
  788.     SHARED peg() AS object
  789.     SHARED music AS _BYTE, sfx AS _BYTE
  790.  
  791.     DIM i AS INTEGER
  792.  
  793.     OPEN "tictactoering.dat" FOR BINARY AS #1
  794.     IF LOF(1) THEN
  795.         DIM signature AS STRING
  796.         signature = SPACE$(7)
  797.         GET #1, 1, signature
  798.         IF signature <> "tttring" THEN
  799.             CLOSE #1
  800.             EXIT SUB
  801.         END IF
  802.         GET #1, , music
  803.         GET #1, , sfx
  804.         GET #1, , score
  805.         GET #1, , highscore
  806.         GET #1, , level
  807.         GET #1, , gameOver
  808.  
  809.         IF gameOver = false THEN
  810.             FOR i = 1 TO 12
  811.                 GET #1, , peg(i)
  812.             NEXT
  813.         ELSE
  814.             gameOver = false
  815.             score = 0
  816.             level = 0
  817.         END IF
  818.     ELSE
  819.         'user just upgraded from first versions?
  820.         'retrieve their highscore and kill old file
  821.         CLOSE #1
  822.         IF _FILEEXISTS("tictactoering.score") THEN
  823.             OPEN "tictactoering.score" FOR BINARY AS #1
  824.             IF LOF(1) THEN
  825.                 GET #1, 1, score
  826.                 GET #1, , highscore
  827.                 GET #1, , level
  828.                 GET #1, , gameOver
  829.  
  830.                 IF gameOver = false THEN
  831.                     FOR i = 1 TO 12
  832.                         GET #1, , peg(i)
  833.                     NEXT
  834.                 ELSE
  835.                     gameOver = false
  836.                     score = 0
  837.                     level = 0
  838.                 END IF
  839.             END IF
  840.             CLOSE #1
  841.             KILL "tictactoering.score"
  842.         END IF
  843.     END IF
  844.     CLOSE #1
  845.  
  846. SUB addParticles (x AS SINGLE, y AS SINGLE, total AS INTEGER, c AS _UNSIGNED LONG)
  847.     DIM addedP AS INTEGER, p AS INTEGER
  848.     DIM a AS SINGLE
  849.     SHARED particle() AS object
  850.  
  851.     addedP = 0: p = 0
  852.     DO
  853.         p = p + 1
  854.         IF p > UBOUND(particle) THEN EXIT DO
  855.         IF particle(p).state = true THEN _CONTINUE
  856.         addedP = addedP + 1
  857.         particle(p).state = true
  858.         particle(p).x = x
  859.         particle(p).y = y
  860.         a = RND * _PI(2)
  861.         particle(p).xv = COS(a) * (RND * 10)
  862.         particle(p).yv = SIN(a) * (RND * 10)
  863.         particle(p).r = _RED32(c)
  864.         particle(p).g = _GREEN32(c)
  865.         particle(p).b = _BLUE32(c)
  866.         particle(p).size = _CEIL(RND * 3)
  867.         particle(p).start = TIMER
  868.         particle(p).duration = RND
  869.     LOOP UNTIL addedP >= total
  870.  
  871. SUB updateScore
  872.     STATIC lastScoreUpdate AS SINGLE, lastHighScoreUpdate AS SINGLE
  873.     SHARED visibleScore AS _UNSIGNED LONG, score AS _UNSIGNED LONG
  874.     SHARED visibleHighScore AS _UNSIGNED LONG, highscore AS _UNSIGNED LONG
  875.     SHARED animation() AS object, woodblock AS LONG
  876.     SHARED sfx AS _BYTE
  877.  
  878.     IF visibleScore < score AND TIMER - lastScoreUpdate > .05 AND animation(8).start = 0 THEN
  879.         visibleScore = visibleScore + 1
  880.         IF woodblock > 0 AND sfx THEN _SNDPLAYCOPY woodblock
  881.         lastScoreUpdate = TIMER
  882.     END IF
  883.  
  884.     IF visibleHighScore < highscore AND TIMER - lastHighScoreUpdate > .05 AND animation(8).start = 0 THEN
  885.         visibleHighScore = visibleHighScore + 1
  886.         lastHighScoreUpdate = TIMER
  887.     END IF
  888.  
  889. SUB updateParticles
  890.     DIM i AS INTEGER
  891.     SHARED particle() AS object
  892.  
  893.     FOR i = 1 TO UBOUND(particle)
  894.         CONST gravity = .1
  895.         IF particle(i).state THEN
  896.             particle(i).xv = particle(i).xv + particle(i).xa
  897.             particle(i).x = particle(i).x + particle(i).xv
  898.             particle(i).yv = particle(i).yv + particle(i).ya + gravity
  899.             particle(i).y = particle(i).y + particle(i).yv
  900.  
  901.             IF particle(i).x > _WIDTH OR particle(i).x < 0 OR particle(i).y > _HEIGHT OR particle(i).y < 0 THEN
  902.                 particle(i).state = false
  903.             ELSE
  904.                 CircleFill particle(i).x, particle(i).y, particle(i).size, _RGB32(particle(i).r, particle(i).g, particle(i).b, map(TIMER - particle(i).start, 0, particle(i).duration, 255, 0))
  905.             END IF
  906.         END IF
  907.     NEXT
  908.  
  909. SUB hoverHighlight
  910.     SHARED peg() AS object
  911.     SHARED emptySet$
  912.     SHARED dragging AS INTEGER
  913.  
  914.     STATIC highLit AS INTEGER, glow AS SINGLE, glowStep AS SINGLE
  915.     DIM halo AS INTEGER
  916.     DIM i AS INTEGER, k AS SINGLE, j AS SINGLE
  917.  
  918.     IF dragging THEN EXIT SUB
  919.  
  920.     FOR i = 10 TO 12
  921.         IF peg(i).set = emptySet$ THEN _CONTINUE
  922.         IF dist(peg(i).x, peg(i).y, _MOUSEX, _MOUSEY) <= 40 THEN
  923.             k = 0
  924.             IF MID$(peg(i).set, 5, 2) <> MKI$(-1) THEN
  925.                 halo = 40
  926.             ELSEIF MID$(peg(i).set, 3, 2) <> MKI$(-1) THEN
  927.                 halo = 25
  928.             ELSE
  929.                 halo = 12
  930.             END IF
  931.  
  932.             IF highLit <> i THEN
  933.                 highLit = i
  934.                 glow = 10
  935.                 glowStep = .2
  936.             END IF
  937.  
  938.             IF glowStep = 0 THEN glowStep = .2
  939.             glow = glow + glowStep
  940.             IF glow < 8 THEN glow = 8: glowStep = glowStep * -1
  941.             IF glow > 16 THEN glow = 16: glowStep = glowStep * -1
  942.  
  943.             FOR j = glow TO 8 STEP -.5
  944.                 k = k + .8
  945.                 CircleFill peg(i).x, peg(i).y, halo + k, _RGB32(255, j)
  946.                 CircleFill peg(i).x, peg(i).y, (halo / 2) + k, _RGB32(0, j)
  947.             NEXT
  948.  
  949.             EXIT FOR
  950.         END IF
  951.     NEXT
  952.  
  953. SUB checkAvailableMoves
  954.     SHARED dragging AS INTEGER
  955.     SHARED peg() AS object
  956.     SHARED emptySet$
  957.     SHARED gameOver AS _BYTE
  958.     SHARED placed AS _BYTE
  959.  
  960.     DIM i AS INTEGER, j AS INTEGER, k AS INTEGER
  961.  
  962.     IF dragging = 0 THEN
  963.         IF peg(10).set <> emptySet$ OR peg(11).set <> emptySet$ OR peg(12).set <> emptySet$ THEN
  964.             gameOver = true 'glass is half empty; consider no more moves
  965.             FOR i = 10 TO 12
  966.                 IF peg(i).set <> emptySet$ THEN
  967.                     'can this set fit the board?
  968.                     FOR j = 1 TO 9
  969.                         placed = true
  970.                         FOR k = 1 TO 3
  971.                             IF CVI(MID$(peg(i).set, k * 2 - 1, 2)) > 0 AND CVI(MID$(peg(j).set, k * 2 - 1, 2)) > 0 THEN
  972.                                 placed = false
  973.                                 EXIT FOR
  974.                             END IF
  975.                         NEXT
  976.                         IF placed THEN gameOver = false: EXIT FOR
  977.                     NEXT
  978.                 END IF
  979.                 IF gameOver = false THEN EXIT FOR 'no need to test further, there's still hope
  980.             NEXT
  981.         END IF
  982.  
  983.         IF gameOver = false THEN
  984.             'is board full?
  985.             'that means we used all sets and no matches were found = game over
  986.             DIM board$
  987.             board$ = ""
  988.             FOR i = 1 TO 9
  989.                 board$ = board$ + peg(i).set
  990.             NEXT
  991.             IF INSTR(board$, MKI$(-1)) = 0 THEN gameOver = true
  992.         END IF
  993.     END IF
  994.  
  995. SUB drawRings
  996.     DIM i AS INTEGER
  997.     SHARED peg() AS object
  998.     SHARED circleImage() AS LONG
  999.     SHARED dragging AS INTEGER
  1000.     SHARED thisColor AS INTEGER
  1001.  
  1002.     DIM x AS SINGLE, y AS SINGLE
  1003.     DIM j AS INTEGER
  1004.  
  1005.     FOR i = 1 TO 12
  1006.         IF i = dragging THEN
  1007.             x = _MOUSEX
  1008.             y = _MOUSEY
  1009.         ELSE
  1010.             x = peg(i).x
  1011.             y = peg(i).y
  1012.         END IF
  1013.  
  1014.         FOR j = 1 TO 3
  1015.             thisColor = CVI(MID$(peg(i).set, j * 2 - 1, 2))
  1016.             IF thisColor > 0 THEN
  1017.                 _PUTIMAGE (x - (_WIDTH(circleImage(thisColor, j)) / 2), y - (_HEIGHT(circleImage(thisColor, j)) / 2)), circleImage(thisColor, j)
  1018.             END IF
  1019.         NEXT
  1020.     NEXT
  1021.  
  1022. SUB CircleFill (x AS LONG, y AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  1023.     DIM x0 AS SINGLE, y0 AS SINGLE
  1024.     DIM e AS SINGLE
  1025.  
  1026.     x0 = R
  1027.     y0 = 0
  1028.     e = -R
  1029.     DO WHILE y0 < x0
  1030.         IF e <= 0 THEN
  1031.             y0 = y0 + 1
  1032.             LINE (x - x0, y + y0)-(x + x0, y + y0), C, BF
  1033.             LINE (x - x0, y - y0)-(x + x0, y - y0), C, BF
  1034.             e = e + 2 * y0
  1035.         ELSE
  1036.             LINE (x - y0, y - x0)-(x + y0, y - x0), C, BF
  1037.             LINE (x - y0, y + x0)-(x + y0, y + x0), C, BF
  1038.             x0 = x0 - 1
  1039.             e = e - 2 * x0
  1040.         END IF
  1041.     LOOP
  1042.     LINE (x - R, y)-(x + R, y), C, BF
  1043.  
  1044. FUNCTION map! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
  1045.     map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
  1046.  
  1047. FUNCTION lerp! (start!, stp!, amt!)
  1048.     DIM mult AS INTEGER
  1049.     IF start! < stp! THEN mult = -1 ELSE mult = 1
  1050.     lerp! = (mult * amt!) * (stp! - start!) + start!
  1051.  
  1052. FUNCTION dist! (x1!, y1!, x2!, y2!)
  1053.     dist! = _HYPOT((x2! - x1!), (y2! - y1!))
  1054.  
  1055. SUB printLarge (x AS SINGLE, y AS SINGLE, text$, fontSize AS INTEGER)
  1056.     DIM i AS LONG, j AS LONG, c AS LONG, char AS _UNSIGNED _BYTE
  1057.  
  1058.     IF fontSize = 0 THEN fontSize = 1
  1059.  
  1060.     FOR c = 1 TO LEN(text$)
  1061.         char = ASC(text$, c)
  1062.         FOR i = 1 TO 16
  1063.             FOR j = 1 TO 8
  1064.                 IF charSet(char, i, j) THEN
  1065.                     IF _PRINTMODE <> 2 THEN
  1066.                         LINE ((x - fontSize) + j * fontSize + ((c - 1) * (fontSize * 8)), (y - fontSize) + i * fontSize)-STEP(fontSize - 1, fontSize - 1), _DEFAULTCOLOR, BF
  1067.                     END IF
  1068.                 ELSE
  1069.                     IF _PRINTMODE = 3 OR _PRINTMODE = 2 THEN
  1070.                         LINE ((x - fontSize) + j * fontSize + ((c - 1) * (fontSize * 8)), (y - fontSize) + i * fontSize)-STEP(fontSize - 1, fontSize - 1), _BACKGROUNDCOLOR, BF
  1071.                     END IF
  1072.                 END IF
  1073.             NEXT
  1074.         NEXT
  1075.     NEXT
  1076.  
  1077. SUB centerLarge (y AS SINGLE, text$, fontSize AS INTEGER)
  1078.     printLarge (_WIDTH - printWidthLarge(text$, fontSize)) / 2, y, text$, fontSize
  1079.  
  1080. FUNCTION fontHeightLarge (fontSize AS INTEGER)
  1081.     fontHeightLarge = fontSize * 16
  1082.  
  1083. FUNCTION fontWidthLarge (fontSize AS INTEGER)
  1084.     fontWidthLarge = fontSize * 8
  1085.  
  1086. FUNCTION printWidthLarge (text$, fontSize AS INTEGER)
  1087.     printWidthLarge = fontWidthLarge(fontSize) * LEN(text$)
  1088.  
  1089. SUB initializeCharSetPrintLarge
  1090.     DIM char, row, column
  1091.     RESTORE charSet8x16
  1092.     FOR char = 0 TO 255
  1093.         FOR row = 1 TO 16
  1094.             FOR column = 1 TO 8
  1095.                 READ charSet(char, row, column)
  1096.             NEXT
  1097.         NEXT
  1098.     NEXT
  1099.  
  1100.     charSet8x16:
  1101.     DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,-1,-1,-1,0,0,0,0,-1,-1,0,-1,-1,0,0,0,0,0,-1,-1,0,0,0,0,0,-1,-1,0,0,0,0,0,-1,-1,0,0,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1183.     DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  1184.  
  1185. SUB pause (duration AS SINGLE)
  1186.     DIM j AS SINGLE
  1187.     j = TIMER
  1188.     DO
  1189.         _DISPLAY
  1190.         _LIMIT 30
  1191.     LOOP UNTIL TIMER - j > duration OR _KEYHIT
  1192.  
  1193. SUB endScreen
  1194.     SHARED gameOver AS _BYTE, keyb AS LONG
  1195.     SHARED animation() AS object, peg() AS object
  1196.     SHARED bg AS LONG, bgWithoutShelf AS LONG
  1197.     SHARED m$(), emptySet$
  1198.     SHARED userQuit AS _BYTE
  1199.     SHARED score AS _UNSIGNED LONG, visibleScore AS _UNSIGNED LONG
  1200.     SHARED level AS _UNSIGNED LONG
  1201.  
  1202.     DIM k AS INTEGER, i AS INTEGER
  1203.  
  1204.     IF gameOver OR keyb = -27 THEN
  1205.         'flash and screenshot
  1206.         DIM screenshot AS LONG, screenshot2 AS LONG
  1207.         screenshot = _COPYIMAGE(_DISPLAY)
  1208.  
  1209.         animation(0).start = TIMER
  1210.         DO
  1211.             DIM screenshotSize AS INTEGER, zoomOut AS INTEGER
  1212.             zoomOut = 200
  1213.             screenshotSize = map(TIMER - animation(0).start, 0, .5, _WIDTH, _WIDTH - zoomOut)
  1214.             IF screenshotSize < _WIDTH - zoomOut THEN screenshotSize = _WIDTH - zoomOut
  1215.             CLS
  1216.             _PUTIMAGE (0, 0), bgWithoutShelf
  1217.             _PUTIMAGE ((_WIDTH - screenshotSize) / 2, 0)-STEP(screenshotSize, screenshotSize), screenshot
  1218.             IF TIMER - animation(0).start < .3 THEN
  1219.                 LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - animation(0).start, 0, .3, 0, 255)), BF
  1220.             END IF
  1221.             updateParticles
  1222.             _DISPLAY
  1223.             _LIMIT 60
  1224.         LOOP UNTIL TIMER - animation(0).start > .75
  1225.  
  1226.         IF gameOver THEN
  1227.             m$(1) = "Game Over"
  1228.             COLOR _RGB32(255)
  1229.             k = 4
  1230.             printLarge (_WIDTH - printWidthLarge(m$(1), k)) / 2, _HEIGHT - fontHeightLarge(k) * 2.5, m$(1), k
  1231.         END IF
  1232.  
  1233.         screenshot2 = _COPYIMAGE(_DISPLAY)
  1234.  
  1235.         'end screen buttons
  1236.         SHARED currentButton AS INTEGER
  1237.         SHARED totalButtons AS INTEGER
  1238.         SHARED button() AS object, caption() AS STRING
  1239.  
  1240.         currentButton = 0
  1241.         totalButtons = 2
  1242.         FOR i = 1 TO 2
  1243.             button(i).h = _FONTHEIGHT + 10
  1244.             button(i).w = _PRINTWIDTH("  Continue  ")
  1245.         NEXT
  1246.  
  1247.         DIM startX AS INTEGER
  1248.         startX = (_WIDTH - button(1).w * totalButtons) / 2
  1249.         FOR i = 1 TO totalButtons
  1250.             button(i).y = _HEIGHT - fontHeightLarge(3) * 2
  1251.             button(i).x = startX
  1252.             startX = startX + button(i).w
  1253.         NEXT
  1254.  
  1255.         IF gameOver THEN
  1256.             caption(1) = "Restart"
  1257.             caption(2) = "Quit"
  1258.         ELSE
  1259.             caption(1) = "Continue"
  1260.             caption(2) = "Restart"
  1261.         END IF
  1262.  
  1263.         DO
  1264.             SHARED mainTrackVolume AS SINGLE, track() AS LONG, music AS _BYTE
  1265.             IF music THEN
  1266.                 IF mainTrackVolume < 1 THEN
  1267.                     mainTrackVolume = mainTrackVolume + .05
  1268.                     IF track(1) > 0 THEN _SNDVOL track(1), mainTrackVolume
  1269.                 END IF
  1270.             END IF
  1271.  
  1272.             keyb = _KEYHIT
  1273.             WHILE _MOUSEINPUT: WEND
  1274.             DIM mx AS INTEGER, my AS INTEGER
  1275.             mx = _MOUSEX
  1276.             my = _MOUSEY
  1277.  
  1278.             _PUTIMAGE (0, 0), screenshot2
  1279.             doButtons
  1280.             DIM mouseDown AS _BYTE
  1281.             checkButtons
  1282.  
  1283.             DIM prevbt AS INTEGER
  1284.             IF currentButton <> prevbt THEN
  1285.                 SHARED selectSound AS LONG, sfx AS _BYTE
  1286.                 IF currentButton > 0 AND sfx AND selectSound > 0 THEN _SNDPLAYCOPY selectSound
  1287.                 prevbt = currentButton
  1288.             END IF
  1289.  
  1290.             SELECT CASE keyb
  1291.                 CASE 19200 'left
  1292.                     currentButton = 1
  1293.                 CASE 19712 'right
  1294.                     currentButton = 2
  1295.                 CASE -13
  1296.                     mouseDown = true
  1297.                 CASE -27
  1298.                     EXIT DO
  1299.             END SELECT
  1300.  
  1301.             IF _MOUSEBUTTON(1) THEN
  1302.                 mouseDown = true
  1303.             ELSE
  1304.                 IF mouseDown THEN
  1305.                     SELECT CASE currentButton
  1306.                         CASE 1
  1307.                             keyb = -121
  1308.                             EXIT DO
  1309.                         CASE 2
  1310.                             keyb = -110
  1311.                             EXIT DO
  1312.                     END SELECT
  1313.                     addParticles mx, my, 30, _RGB32(255)
  1314.                     addParticles mx, my, 30, _RGB32(122, 89, 144)
  1315.                 END IF
  1316.                 mouseDown = false
  1317.             END IF
  1318.  
  1319.             updateParticles
  1320.  
  1321.             userQuit = _EXIT
  1322.             _DISPLAY
  1323.             _LIMIT 30
  1324.         LOOP UNTIL keyb = -13 OR keyb = -27 OR keyb = -110 OR keyb = -78 OR keyb = -121 OR keyb = -89 OR userQuit
  1325.  
  1326.         IF (gameOver AND (keyb = -110 OR keyb = -78)) OR userQuit THEN SYSTEM
  1327.  
  1328.         IF (gameOver AND (keyb = -13 OR keyb = -121 OR keyb = -89)) OR (gameOver = false AND (keyb = -110 OR keyb = -78)) THEN
  1329.             IF track(1) > 0 AND music THEN _SNDSTOP track(1): _SNDLOOP track(1) 'restart main track
  1330.             gameOver = false
  1331.             score = 0
  1332.             visibleScore = 0
  1333.             level = 0
  1334.             animation(0).start = TIMER
  1335.             FOR i = 1 TO 12
  1336.                 peg(i).set = emptySet$
  1337.             NEXT
  1338.         ELSE
  1339.             'bring screenshot back to front
  1340.             animation(0).start = TIMER
  1341.             DO
  1342.                 zoomOut = 200
  1343.                 screenshotSize = map(TIMER - animation(0).start, 0, .5, _WIDTH - zoomOut, _WIDTH)
  1344.                 IF screenshotSize > _WIDTH THEN screenshotSize = _WIDTH
  1345.                 CLS
  1346.                 _PUTIMAGE (0, 0), bgWithoutShelf
  1347.                 _PUTIMAGE ((_WIDTH - screenshotSize) / 2, 0)-STEP(screenshotSize, screenshotSize), screenshot
  1348.                 IF TIMER - animation(0).start <= .3 THEN
  1349.                     LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - animation(0).start, 0, .3, 0, 255)), BF
  1350.                 END IF
  1351.                 _DISPLAY
  1352.                 _LIMIT 60
  1353.             LOOP UNTIL TIMER - animation(0).start > .5
  1354.         END IF
  1355.  
  1356.         _FREEIMAGE screenshot
  1357.         _FREEIMAGE screenshot2
  1358.         _KEYCLEAR
  1359.         currentButton = 0
  1360.     END IF
  1361.  
  1362. SUB settingsScreen
  1363.     SHARED gameOver AS _BYTE, keyb AS LONG
  1364.     SHARED animation() AS object, peg() AS object
  1365.     SHARED bg AS LONG, bgWithoutShelf AS LONG
  1366.     SHARED m$(), emptySet$
  1367.     SHARED userQuit AS _BYTE
  1368.     SHARED score AS _UNSIGNED LONG, visibleScore AS _UNSIGNED LONG
  1369.     SHARED level AS _UNSIGNED LONG
  1370.  
  1371.     'flash and screenshot
  1372.     DIM screenshot AS LONG
  1373.     screenshot = _COPYIMAGE(_DISPLAY)
  1374.  
  1375.     animation(0).start = TIMER
  1376.     DO
  1377.         DIM screenshotSize AS INTEGER, zoomOut AS INTEGER
  1378.         zoomOut = 400
  1379.         screenshotSize = map(TIMER - animation(0).start, 0, .5, _WIDTH, _WIDTH - zoomOut)
  1380.         IF screenshotSize < _WIDTH - zoomOut THEN screenshotSize = _WIDTH - zoomOut
  1381.         CLS
  1382.         _PUTIMAGE (0, 0), bgWithoutShelf
  1383.         _PUTIMAGE (0, (_HEIGHT - screenshotSize) / 2)-STEP(screenshotSize, screenshotSize), screenshot
  1384.         IF TIMER - animation(0).start < .3 THEN
  1385.             LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - animation(0).start, 0, .3, 0, 255)), BF
  1386.         END IF
  1387.  
  1388.         updateParticles
  1389.         _DISPLAY
  1390.         _LIMIT 60
  1391.     LOOP UNTIL TIMER - animation(0).start > .75
  1392.  
  1393.     SHARED button() AS object
  1394.     SHARED caption() AS STRING
  1395.     SHARED totalButtons AS INTEGER
  1396.     SHARED currentButton AS INTEGER
  1397.  
  1398.     'settings buttons
  1399.     SHARED music AS _BYTE, sfx AS _BYTE
  1400.     DIM i AS INTEGER
  1401.     currentButton = 0
  1402.     totalButtons = 4
  1403.     FOR i = 1 TO totalButtons - 1
  1404.         button(i).h = _FONTHEIGHT + 10
  1405.         button(i).w = _PRINTWIDTH("  ENOUGH WIDTH FOR ALL CHOICES  ")
  1406.     NEXT
  1407.  
  1408.     caption(3) = "Return to game"
  1409.  
  1410.     DIM startY AS INTEGER
  1411.     startY = (_HEIGHT - button(1).h * totalButtons - 1) / 2
  1412.     FOR i = 1 TO totalButtons - 1
  1413.         button(i).y = startY
  1414.         button(i).x = _WIDTH - _WIDTH / 3 - button(i).w / 2
  1415.         startY = startY + button(i).h
  1416.     NEXT
  1417.  
  1418.     button(4).x = 0
  1419.     button(4).y = (_HEIGHT - screenshotSize) / 2
  1420.     button(4).w = screenshotSize
  1421.     button(4).h = screenshotSize
  1422.  
  1423.     DO
  1424.         CLS
  1425.         _PUTIMAGE (0, 0), bgWithoutShelf
  1426.         _PUTIMAGE (0, (_HEIGHT - screenshotSize) / 2)-STEP(screenshotSize, screenshotSize), screenshot
  1427.  
  1428.         DIM mx AS INTEGER, my AS INTEGER
  1429.         WHILE _MOUSEINPUT: WEND
  1430.         mx = _MOUSEX
  1431.         my = _MOUSEY
  1432.         keyb = _KEYHIT
  1433.         userQuit = _EXIT
  1434.  
  1435.         IF music THEN
  1436.             caption(1) = "Music: ON"
  1437.         ELSE
  1438.             caption(1) = "Music: OFF"
  1439.         END IF
  1440.  
  1441.         IF sfx THEN
  1442.             caption(2) = "Sound effects: ON"
  1443.         ELSE
  1444.             caption(2) = "Sound effects: OFF"
  1445.         END IF
  1446.  
  1447.         doButtons
  1448.         DIM mouseDown AS _BYTE
  1449.         checkButtons
  1450.  
  1451.         DIM prevbt AS INTEGER
  1452.         IF currentButton <> prevbt THEN
  1453.             SHARED selectSound AS LONG
  1454.             IF currentButton > 0 AND sfx AND selectSound > 0 THEN _SNDPLAYCOPY selectSound
  1455.             prevbt = currentButton
  1456.         END IF
  1457.  
  1458.         SELECT CASE keyb
  1459.             CASE 18432 'up
  1460.                 currentButton = currentButton - 1
  1461.                 IF currentButton < 1 THEN currentButton = 1
  1462.             CASE 20480 'down
  1463.                 currentButton = currentButton + 1
  1464.                 IF currentButton > totalButtons THEN currentButton = totalButtons
  1465.             CASE 19200 'left
  1466.                 IF currentButton < 4 THEN currentButton = 4
  1467.             CASE 19712 'right
  1468.                 IF currentButton = 4 THEN currentButton = 1
  1469.             CASE -13
  1470.                 mouseDown = true
  1471.                 IF currentButton > 0 THEN
  1472.                     mx = button(currentButton).x + button(currentButton).w / 2
  1473.                     my = button(currentButton).y + button(currentButton).h / 2
  1474.                 END IF
  1475.             CASE -27
  1476.                 EXIT DO
  1477.         END SELECT
  1478.  
  1479.         IF _MOUSEBUTTON(1) THEN
  1480.             mouseDown = true
  1481.         ELSE
  1482.             IF mouseDown THEN
  1483.                 SELECT CASE currentButton
  1484.                     CASE 1
  1485.                         music = NOT music
  1486.                         SHARED track() AS LONG
  1487.                         IF track(1) > 0 AND music THEN _SNDLOOP track(1)
  1488.                         IF track(1) > 0 AND music = false THEN _SNDSTOP track(1)
  1489.                     CASE 2
  1490.                         sfx = NOT sfx
  1491.                         SHARED wooshSound AS LONG
  1492.                         IF wooshSound > 0 AND sfx THEN _SNDPLAYCOPY wooshSound
  1493.                     CASE 3, 4
  1494.                         EXIT DO
  1495.                 END SELECT
  1496.                 addParticles mx, my, 30, _RGB32(255)
  1497.                 addParticles mx, my, 30, _RGB32(67, 172, 183)
  1498.             END IF
  1499.             mouseDown = false
  1500.         END IF
  1501.  
  1502.         'game title
  1503.         COLOR _RGB32(0)
  1504.         centerLarge (_HEIGHT / 7) + 3, "Settings", 4
  1505.         centerLarge (_HEIGHT - _HEIGHT / 4) - fontHeightLarge(2) + 3, "Tic Tac Toe", 2
  1506.         centerLarge (_HEIGHT - _HEIGHT / 4) + 3, "Rings", 7
  1507.  
  1508.         COLOR _RGB32(255)
  1509.         centerLarge (_HEIGHT / 7), "Settings", 4
  1510.         centerLarge (_HEIGHT - _HEIGHT / 4) - fontHeightLarge(2), "Tic Tac Toe", 2
  1511.         centerLarge (_HEIGHT - _HEIGHT / 4), "Rings", 7
  1512.  
  1513.         updateParticles
  1514.  
  1515.         _DISPLAY
  1516.         _LIMIT 30
  1517.     LOOP UNTIL userQuit
  1518.  
  1519.     IF (gameOver AND (keyb = -110 OR keyb = -78)) OR userQuit THEN SYSTEM
  1520.  
  1521.     'bring screenshot back to front
  1522.     animation(0).start = TIMER
  1523.     DO
  1524.         zoomOut = 200
  1525.         screenshotSize = map(TIMER - animation(0).start, 0, .5, _WIDTH - zoomOut, _WIDTH)
  1526.         IF screenshotSize > _WIDTH THEN screenshotSize = _WIDTH
  1527.         CLS
  1528.         _PUTIMAGE (0, 0), bgWithoutShelf
  1529.         _PUTIMAGE (0, (_HEIGHT - screenshotSize) / 2)-STEP(screenshotSize, screenshotSize), screenshot
  1530.         IF TIMER - animation(0).start <= .3 THEN
  1531.             LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB32(255, map(TIMER - animation(0).start, 0, .3, 0, 255)), BF
  1532.         END IF
  1533.         _DISPLAY
  1534.         _LIMIT 60
  1535.     LOOP UNTIL TIMER - animation(0).start > .5
  1536.  
  1537.     _FREEIMAGE screenshot
  1538.     _KEYCLEAR
  1539.     currentButton = 0
  1540.  
  1541. SUB createMainScreenButtons
  1542.     SHARED totalButtons AS INTEGER
  1543.     SHARED caption() AS STRING
  1544.     SHARED button() AS object
  1545.     SHARED currentButton AS INTEGER
  1546.  
  1547.     totalButtons = 1
  1548.     caption(1) = "Settings"
  1549.     button(1).h = _FONTHEIGHT + 10
  1550.     button(1).w = _PRINTWIDTH(caption(1) + "    ")
  1551.     button(1).y = _HEIGHT - button(1).h - 1
  1552.     button(1).x = _WIDTH - button(1).w - 1
  1553.  
  1554.     'caption(2) = CHR$(221) + CHR$(222)
  1555.     'button(2).h = _FONTHEIGHT + 10
  1556.     'button(2).w = _PRINTWIDTH(caption(2) + "    ")
  1557.     'button(2).y = 0
  1558.     'button(2).x = button(1).x - button(2).w
  1559.  
  1560. SUB doButtons
  1561.     SHARED totalButtons AS INTEGER
  1562.     SHARED caption() AS STRING
  1563.     SHARED button() AS object
  1564.     SHARED currentButton AS INTEGER
  1565.     DIM i AS INTEGER
  1566.  
  1567.     FOR i = 1 TO totalButtons
  1568.         LINE (button(i).x, button(i).y)-STEP(button(i).w, button(i).h), _RGB32(255), B
  1569.         IF i = currentButton THEN
  1570.             LINE (button(currentButton).x, button(currentButton).y)-STEP(button(currentButton).w, button(currentButton).h), _RGB32(255, 80), BF
  1571.             COLOR _RGB32(0)
  1572.             DIM shadowDepth AS INTEGER
  1573.             shadowDepth = 2
  1574.             _PRINTSTRING (button(i).x + (button(i).w - _PRINTWIDTH(caption(i))) / 2 + shadowDepth, button(i).y + button(i).h / 2 - _FONTHEIGHT / 2 + shadowDepth), caption(i)
  1575.         END IF
  1576.         COLOR _RGB32(255)
  1577.         _PRINTSTRING (button(i).x + (button(i).w - _PRINTWIDTH(caption(i))) / 2, button(i).y + button(i).h / 2 - _FONTHEIGHT / 2), caption(i)
  1578.     NEXT
  1579.  
  1580. SUB checkButtons
  1581.     SHARED totalButtons AS INTEGER
  1582.     SHARED caption() AS STRING
  1583.     SHARED button() AS object
  1584.     SHARED currentButton AS INTEGER
  1585.     DIM i AS INTEGER
  1586.     STATIC lastMouseX AS INTEGER, lastMouseY AS INTEGER
  1587.  
  1588.     IF _MOUSEX <> lastMouseX OR _MOUSEY <> lastMouseY THEN
  1589.         lastMouseX = _MOUSEX
  1590.         lastMouseY = _MOUSEY
  1591.  
  1592.         currentButton = 0
  1593.         FOR i = 1 TO totalButtons
  1594.             IF _MOUSEX > button(i).x AND _MOUSEX < button(i).x + button(i).w AND _MOUSEY > button(i).y AND _MOUSEY < button(i).y + button(i).h THEN
  1595.                 currentButton = i
  1596.                 EXIT FOR
  1597.             END IF
  1598.         NEXT
  1599.     END IF



https://github.com/FellippeHeitor/TicTacToeRing/archive/master.zip

17
Games / Moon Lander by Richard Frost
« on: May 19, 2020, 05:16:56 am »
Moon Lander

Author: @Richard Frost
Source: qb64.org Forum
URL: https://www.qb64.org/forum/index.php?topic=1022.0
Version: May 15, 2020
Tags: [Graphics], [Skill]

Description:
Lunar Lander based on a 1974 program running on a DEC PDP/11 with GT40 vector display terminal at the University of Alberta.  Initially written in QB4.5 (hence the convoluted code to save space), upgraded to use some QB64 features.  Updated May 15, 2020 -  More effects (at warp speeds) and cookies!

Controls:
The multifarious keyboard controls are given by pressing F1 (Help) when the program is run.

Source Code:
Code: QB64: [Select]
  1. ' Moon Lander by rfrost@mail.com
  2.  
  3. $EXEICON:'.\astro.ico'
  4.  
  5. DEFINT A-Z
  6. DIM SHARED a '                                                        angle of craft
  7. DIM SHARED a51i '                                                     Area 51 initializations
  8. DIM SHARED APdisengage '                                              AutoPilot disengage
  9. DIM SHARED ASO '                                                      ascent stage only
  10. DIM SHARED auto '                                                     autopilot
  11. DIM SHARED background '                                               for instrument panel
  12. DIM SHARED bh '                                                       black hole
  13. DIM SHARED bhx, bhy '                                                 black hole
  14. DIM SHARED bbit '                                                     blinking bit synced to time
  15. DIM SHARED bolthit, bolthitf, boltx '                                 Deathstar hit vehicle, feature
  16. DIM SHARED borgl, borgr, borgt '                                      left right top, distance
  17. DIM SHARED bstyle1, bstyle2 '                                         Borg matrix/lines/Moire
  18. DIM SHARED bw '                                                       black and white
  19. DIM SHARED c '                                                        usually color
  20. DIM SHARED canvas& '                                                  primary screen
  21. DIM SHARED cbh '                                                      constant black holes
  22. DIM SHARED center '                                                   varies according to gs (graphics start)
  23. DIM SHARED chs '                                                      parachute size
  24. DIM SHARED contact '                                                  landed
  25. DIM SHARED convo '                                                    conversation active LM/CM
  26. DIM SHARED cpal '                                                     color palette, normal/green/b&w (32 color kludge/fun)
  27. DIM SHARED craft '                                                    color
  28. DIM SHARED crash '                                                    layer of debris
  29. DIM SHARED cwd, cwsi, cwsd '                                          car wash distance, angles
  30. DIM SHARED cybilltime! '                                              time on screen
  31. DIM SHARED darkstarc '                                                deathstar color set
  32. DIM SHARED darkstars '                                                deathstar spin rate
  33. DIM SHARED darkstart '                                                   "      thickness
  34. DIM SHARED dead$ '                                                    end condition
  35. DIM SHARED debug$ '                                                   messages to God
  36. DIM SHARED demo '                                                     ground features compressed
  37. DIM SHARED doclock '                                                  it's Howdy Doody time
  38. DIM SHARED dosbox '                                                   flag
  39. DIM SHARED dsinit '                                                   deathstar
  40. DIM SHARED eou '                                                      end of universe
  41. DIM SHARED fb$ '                                                      landing feedback/analysis
  42. DIM SHARED flx '                                                      US/USSR flag position
  43. DIM SHARED fuel, fuel! '                                              color of, quantity left
  44. DIM SHARED gh, glmin, glmax '                                         ground height, level
  45. DIM SHARED grav! '                                                    gravity
  46. DIM SHARED gs '                                                       flight area x start
  47. DIM SHARED gstyle '                                                   ground style
  48. DIM SHARED inpause '                                                  flag
  49. DIM SHARED invincible '                                               impervious to threats
  50. DIM SHARED iscd '                                                     don't attempt to write!
  51. DIM SHARED jitter '                                                   shift-T to control
  52. DIM SHARED LEDc '                                                     color
  53. DIM SHARED LEDtri '                                                   tri-color flag
  54. DIM SHARED level '                                                    surface is
  55. DIM SHARED LGMc '                                                     Little Green Man color
  56. DIM SHARED liftoff '                                                  AS only
  57. DIM SHARED lmsl '                                                     LM shield/laser color
  58. DIM SHARED lob '                                                      landed on Borg
  59. DIM SHARED lockfuel '                                                 cheat!
  60. DIM SHARED lp, rp, xp, th1, th2 '                                     pads, radar, thrusters
  61. DIM SHARED magic '                                                    cheat! (instant landing)
  62. DIM SHARED mdelay '                                                   PgUp/PgDn controlled
  63. DIM SHARED msflag '                                                   making surfaces
  64. DIM SHARED mstar '                                                    make stars
  65. DIM SHARED nation '                                                   1 US, 2 USSR (flags & fireworks)
  66. DIM SHARED ok '                                                       at landing, to plant flag
  67. DIM SHARED okrick '                                                   diagnostics
  68. DIM SHARED osc '                                                      on screen count
  69. DIM SHARED oscar '                                                    semaphore land/sea flags
  70. DIM SHARED panelinit '                                                replot flag
  71. DIM SHARED paraf '                                                    parachute flag
  72. DIM SHARED pload '                                                    panel load flag
  73. DIM SHARED porb '                                                     pointers/bargraphs
  74. DIM SHARED ptk '                                                      points to kill (gasoline) ExplodeLM
  75. DIM SHARED px!, py! '                                                 vehicle position on screen
  76. DIM SHARED ra '                                                       random angle
  77. DIM SHARED radarf '                                                   radar on/off
  78. DIM SHARED rads '                                                     Luna radiation
  79. DIM SHARED radiationdeath '                                           flag
  80. DIM SHARED rdtime! '                                                  fun with high res screen (my picture)
  81. DIM SHARED regen '                                                    all star files
  82. DIM SHARED rfx, rfy '                                                 craft jigger
  83. DIM SHARED rick '                                                     debug flag
  84. DIM SHARED rmin, dmin '                                               stars
  85. DIM SHARED settings$ '                                                lander.set
  86. DIM SHARED sf '                                                       surface feature
  87. DIM SHARED shield '                                                   flag
  88. DIM SHARED shoot '                                                    flag
  89. DIM SHARED showmap '                                                  locations of things shown at top
  90. DIM SHARED sia '                                                      shells in air
  91. DIM SHARED skyoff '                                                   for faster performance
  92. DIM SHARED starship '                                                 Enterprise (double shift twice)
  93. DIM SHARED ufof '                                                     for ufo
  94. DIM SHARED sspinit1, sspinit2 '                                       Surveyor
  95. DIM SHARED starfiles '                                                use stars1,2 or 3 (few/med/lots)
  96. DIM SHARED starinit '                                                 flag
  97. DIM SHARED shipi&, shipx '                                            starship
  98. DIM SHARED starstatus '                                               0 off, 1 on, 234 more info
  99. DIM SHARED suri '                                                     surface index
  100. DIM SHARED sx0, sy0 '                                                 LM radar/laser location
  101. DIM SHARED sx1, sy1 '                                                 LM left landing pad
  102. DIM SHARED sx2, sy2 '                                                 LM right landing pad
  103. DIM SHARED temp '                                                     temperature
  104. DIM SHARED thrust! '                                                  0 - 100
  105. DIM SHARED tilef '                                                    tile variation
  106. DIM SHARED vx!, vy! '                                                 LM velocity
  107. DIM SHARED warp! '                                                    vx! >= 100
  108. DIM SHARED wi, wi2 '                                                  width (distance between pads)
  109. DIM SHARED wx!, wy! '                                                 vehicle position on screen
  110. DIM SHARED x '                                                        = suri + px!
  111. DIM SHARED xoff '                                                     offset for v=5-20, Surv & Etna
  112. DIM SHARED zoom '                                                     starfield
  113.  
  114. DIM SHARED blue, green, gunmetal, red, gasoline, gray2, white, gray
  115. DIM SHARED dred, gold, black2, orange, blue2, yellow, white2
  116.  
  117. DIM SHARED q1, q2, q3, q4, h, t, th, tsix, aspect!, pf! '             constants
  118.  
  119. q1 = 6400: q2 = 860: q3 = 639: q4 = 349: h = 100: th = 200: t = 10: tsix = 360
  120. pf! = .5: aspect! = 1.4: grav! = 1.6
  121.  
  122. qt = 2000 '                                                           3 arrays below weren't loading properly with q2
  123. DIM SHARED LMx(qt), LMy(qt), LMc(qt) '                                LM+exhaust x,y,color
  124.  
  125. DIM SHARED LMrx(1400), LMry(1400) '                                   LM+exhaust x,y after rotation
  126. DIM SHARED LMoc(705), LMci(3) '                                       LM colors,original colors, index
  127. DIM SHARED c!(360), s!(360) '                                         sines and cosines
  128. DIM SHARED ex(6), ey(6), exv(6), eyv(6), ei(6), ek(6), exl(6) '       sky objects
  129. DIM SHARED f$(40) '                                                   support files
  130. DIM SHARED mes$(1), omes$(1), sm!(1) '                                messages at screen top
  131. DIM SHARED sf(10, 2), sf$(10) '                                       surface features start/end/middle
  132. DIM SHARED shx(20), shy(20), sha(20) '                                shells (IBM weapons) x,y,angle
  133. DIM SHARED shvx(20), shvy(20), shd(20) '                              velocity, distance
  134. DIM SHARED rtl!(2), rtlc(2) '                                         radiation/temperature/lightning
  135. DIM SHARED gh(6400) '                                                 ground height
  136.  
  137. DIM clocka(2) '                                                       clock angles
  138. DIM cmp&(30) '                                                        CM patterns
  139. DIM convo$(50) '                                                      LM/CM
  140. DIM SHARED gbuff(800) '                                               DS liftoff
  141. DIM skyset1(t), skyset2(t) '                                          skycrud
  142. DIM SHARED p(127, 13), p2(127, 7) '                                   vga and cga fonts
  143. DIM SHARED tflags(30)
  144.  
  145. begin:
  146. GOSUB init1
  147.     GOSUB init2
  148.     WHILE LEN(INKEY$): WEND '                                         clear keyboard buffer
  149.     DO: _LIMIT mdelay
  150.         GOSUB Autopilot
  151.         GOSUB Plotscreen
  152.         GOSUB KeyAndMouse
  153.         IF restart THEN GOTO begin '                                  restore defaults
  154.         IF warp! < 1 THEN GOSUB CheckHit
  155.     LOOP UNTIL contact OR LEN(dead$)
  156.     GOSUB CheckDead
  157.     IF contact THEN
  158.         Evaluate savea, a + ma '                                      landing feedback contact/currentø
  159.         wu2! = TIMER + 1
  160.         GOSUB pause '                                                 landed, Enter for liftoff
  161.         IF restart THEN GOTO begin '                                  restore defaults
  162.         IF k <> 60 THEN GOSUB CheckDead '                             F2 demo restart
  163.     END IF
  164.  
  165. CheckDead:
  166. z$ = LEFT$(LEFT$(dead$, 1) + " ", 1)
  167. IF INSTR(" CBE", z$) = 0 THEN '                                       not Crashed, Borg, Eaten by BH
  168.     ExplodeLM
  169.     contact = 0
  170. dead$ = ""
  171.  
  172. Autopilot:
  173. aboveborg = 0
  174. IF (ek(2) = -1) OR (ek(2) > h) THEN borgt = 0
  175. IF (skyoff = 0) AND (sy1 < borgt) AND (px! > borgl) AND (px! < borgr) THEN aboveborg = 1
  176. super = 0
  177. IF vert OR hover THEN
  178.     GOSUB GetAlt
  179.     i! = alt! / 8 + pf! '                                             thrust target
  180.     IF jitter AND (alt! < t) THEN i! = i! * 2 '                       optional, faster
  181.     IF aboveborg THEN i! = 1
  182.     GOSUB idealthrust
  183.     thrust! = sbest!
  184.     super = -(sbest! > h) '                                           add side thusters
  185.     IF thrust! > h THEN thrust! = h
  186. IF thrust! < 0 THEN thrust! = 0
  187.  
  188. CutOrOutOfFuel:
  189. IF fuel! = 0 THEN shield = 0 '                                        shields need fuel
  190. IF cut = 0 THEN
  191.     cut = 1
  192.     cvy! = vy!
  193.     ctime! = TIMER
  194.     tfollow = 0 '                                                     terrain following
  195.     thrust! = 0
  196.  
  197. idealthrust: '                                                        for hover or descend
  198. IF (alt! < pf!) AND (jitter = 0) THEN i! = .05 '                      soft landing
  199. IF hover THEN i! = hoverc '                                           target
  200. hoverc = hoverc - SGN(hoverc) '                                       up/down
  201. fmin! = q1 '                                                          conventient large number (6400)
  202. ma! = (vmass + fuel!) / th '                                          mass (actually 54% fuel)
  203. ts! = s!((a + 270) MOD tsix) / ma! / power
  204. IF jitter THEN us! = RND * t + 1 ELSE us! = .1
  205. IF powerloss THEN us! = h
  206. FOR z! = 0 TO (h + t) STEP us! '                                      find best thrust 0-110
  207.     fo! = z! * ts!
  208.     aa! = ABS(vy! + grav! + fo! - i!)
  209.     IF aa! < fmin! THEN fmin! = aa!: sbest! = z!
  210.     IF aa! > fmin! THEN EXIT FOR
  211. NEXT z!
  212.  
  213. GoSkyObject:
  214. IF (ek(p) <> -1) AND (contact = 0) THEN
  215.     auto = 0
  216.     a = -ma
  217.     wa = -ma
  218.     lock1 = 0
  219.     suri = ex(p) - center
  220.     GOSUB slimit
  221.     IF p > 2 THEN ey(p) = th '                                        BH, worm, comet, alien
  222.     px! = center
  223.     IF p = 2 THEN py! = 130 '                                         above Borg
  224.     vx! = exv(p)
  225.     eyv(p) = 0
  226.  
  227. KeyAndMouse:
  228.     lb = ABS(_MOUSEBUTTON(1))
  229.     rb = ABS(_MOUSEBUTTON(2))
  230.     IF mouseswap THEN SWAP lb, rb '                                   whatever floats your boat
  231.     IF TIMER < ignoreuntil! THEN lb = 0: rb = 0 '                     2 lines for debouncing
  232.     IF lb OR rb THEN ignoreuntil! = TIMER + .25
  233.     ww = wa '                                                         stash current wanted angle
  234.     wa = wa + lb - rb '                                               want angle
  235.     IF wa <> ww THEN '                                                if changed
  236.         IF inpause THEN i$ = CHR$(13): GOTO gotit '                   either button to cause liftoff
  237.         apd = 1 '                                                     autopilot disconnect warning
  238.         auto = 0 '                                                    autopilot
  239.         GOTO endk '                                                   don't bother checking keys
  240.     END IF
  241.     mw = mw + _MOUSEWHEEL
  242. IF mw <> 0 THEN '                                                     wheel moved
  243.     thrust! = INT(thrust!) - mw
  244.     IF thrust! < 0 THEN thrust! = 0
  245.     IF thrust! > h THEN thrust! = h
  246.     apd = 1 '                                                         autopilot disconnect warning
  247.     auto = 0 '                                                        autopilot
  248.     hover = 0 '                                                       hover off
  249.     vert = 0 '                                                        vertical control off
  250.     mw = 0 '                                                          zap
  251.     GOTO endk '                                                       don't bother checking keys
  252.  
  253. DEF SEG = 0
  254. status = PEEK(&H417) '                                                7ins 6caps 5num 4scrl 3alt 2ctrl 1ls 0rs
  255.  
  256. IF ((status AND 1) > 0) AND ((status AND 2) > 0) THEN '               both shift (cookie!)
  257.     IF rdtime! > 0 THEN starship = 1 '                                must have pressed shift-shift twice, another cookie
  258.     rdtime! = TIMER + 5 '                                             Rick display time
  259.  
  260. IF status AND 8 THEN start1! = TIMER: mpass& = 0 '                    alt, reset speed timer
  261.  
  262. IF status AND 4 THEN '                                                ctrl
  263.     i$ = RIGHT$(" " + INKEY$, 1)
  264.     kk = ASC(i$)
  265.     IF (kk = 3) OR (kk = 19) THEN '                                   c or s
  266.         nfile:
  267.         image = image + 1
  268.         f$ = "CAP" + RIGHT$("0000" + LTRIM$(STR$(image)), 3) + ".BMP"
  269.         IF _FILEEXISTS(f$) THEN GOTO nfile
  270.         SaveImage f$
  271.         IF _FILEEXISTS(f$) THEN mes$(1) = "Screen captured to " + f$
  272.         GOTO endk
  273.     END IF
  274.  
  275. i$ = INKEY$ '                                                         consult human
  276. li = LEN(i$)
  277. IF li = 0 THEN RETURN
  278.  
  279. IF i$ = "|" THEN MakeStarFiles '                                      takes hours!
  280.  
  281. k = ASC(RIGHT$(i$, 1))
  282. IF k = 27 THEN Quit
  283. IF inpause AND (k = 32) THEN
  284.     k = 13 '                                                          transform spacebar to Enter
  285.     i$ = RIGHT$(CHR$(0) + CHR$(k), li) '                              gentlemen, we can rebuild him
  286.  
  287. gotit:
  288. IF (i$ = "\") AND (shx(0) = 0) AND (contact = 0) THEN '               LM drops bomb
  289.     IF (cwd < 50) AND (sy1 > 300) THEN dead$ = "Smooth move, Exlax!" 'kill self in car wash
  290.     sia = sia + 1 '                                                   shells in air
  291.     shvx(0) = vx! + 3 + RND * t
  292.     shvy(0) = 0
  293.     shx(0) = suri + sx0
  294.     shy(0) = sy0
  295.     shd(0) = 1
  296.  
  297. IF i$ = "[" THEN bw = bw XOR 1: Setcolor '                            crude method for b&w
  298. IF i$ = "]" THEN
  299.     ufof = ufof XOR 1
  300.     mes$(0) = "UFO " + OnOff$(ufof)
  301.     IF ufof THEN
  302.         GOSUB SkyStuff
  303.         p = 6: GOSUB GoSkyObject
  304.     END IF
  305.  
  306. IF i$ = "=" THEN GOSUB lmshow '                                       show LM data - pointless but amusing
  307. IF i$ = "'" THEN pdiv = (pdiv + 1) MOD 4 '                            Henon speed, also slows down thrust display
  308. IF radiationdeath THEN i$ = "": RETURN '                              you're dead and cannot pass this point
  309.  
  310. IF i$ = "`" THEN '                                                    Deathstar size - thought a smaller one wouuld be faster - it is - not by much
  311.     dsinit = 0
  312.     dstype = 2 + (MID$(f$(37), 6, 1) = "m")
  313.     MID$(f$(37), 6, 1) = MID$("sm", dstype, 1)
  314. IF i$ = "~" THEN darkstarc = darkstarc XOR 1 '                        color
  315. IF i$ = "@" THEN darkstart = darkstart XOR 1 '                        thickness
  316.  
  317. IF inpause THEN '                                                     hit "p" or landed
  318.     IF i$ = "b" THEN '                                                Big Dipper
  319.         rmin = 9 '                                                    right ascension
  320.         dmin = 30 '                                                   declination
  321.         starinit = 0
  322.         RETURN
  323.     END IF
  324.     IF li = 2 THEN '                                                  arrow keys move stars
  325.         rdol = rmin + dmin '                                          detect change
  326.         rmin = rmin + (k = 75) - (k = 77) '                           left right
  327.         rmin = (rmin + 24) MOD 24 '                                   RA limit 0 - 24
  328.         dmin = dmin - (k = 80) * t + (k = 72) * t '                   declination up down
  329.         IF dmin = h THEN dmin = -80 '                                 limit -90 - 90
  330.         IF dmin = -h THEN dmin = 80
  331.         IF (rmin + dmin) <> rdol THEN starinit = 0 '                  changed, replot stars
  332.     END IF
  333. IF li = 2 THEN GOTO is2 '                                             extended key
  334.  
  335. IF i$ = "_" THEN '                                                    star twinkle
  336.     twinkle = twinkle XOR 1
  337.     mes$(0) = "STAR TWINKLE " + OnOff$(twinkle)
  338. IF i$ = ";" THEN fpl = 1 '                                            force power loss
  339. IF k = 9 THEN ex(1) = (suri + px!) - SGN(exv(1)) * h '                TAB summon DS
  340. p = INSTR(")!@#$%^&*(", i$)
  341. IF p AND (contact = 0) THEN GetSurface p - 1 '                        shifted-number for 1 of 10 surfaces
  342. p = INSTR("01234", i$) '                                              stars off/on/info
  343. IF p THEN starstatus = p - 1
  344. IF k = 8 THEN '                                                       backspace, random star position
  345.     rmin = INT(RND * 24) '                                            random RA
  346.     dmin = (INT(RND * 18) - 9) * t '                                  random dec
  347.     starinit = 0
  348. IF i$ = "." THEN
  349.     tfollow = tfollow XOR 1
  350.     auto = 0
  351.     vert = 1
  352.     mes$(0) = "TERRAIN FOLLOWING " + OnOff$(tfollow)
  353. p = (i$ = "<") - (i$ = ">") '                                         jump left/right
  354. IF (contact = 0) AND (p <> 0) THEN
  355.     suri = suri + 40 * p '                                            surface index
  356.     GOSUB slimit '                                                    limit suri
  357.     IF lock1 THEN hover = 1: lock1 = 0
  358. IF (i$ = "+") AND (zoom < 2) THEN zoom = zoom + 1: starinit = 0
  359. IF (i$ = "-") AND (zoom > 0) THEN zoom = zoom - 1: starinit = 0
  360. IF i$ = "?" THEN rick = rick XOR 1 '                                  show speed of processing graph
  361. IF okrick AND (i$ = "U") THEN tilef = (tilef + 1) MOD 3 '             alternate tilings
  362. IF i$ = "/" THEN
  363.     cpal = (cpal + 1) MOD 4 '                                         cycle green/black & white/normal monitor
  364.     mes$(0) = "": mes$(1) = ""
  365.     IF cpal = 1 THEN mes$(0) = "GT40 mode"
  366.     IF cpal = 2 THEN mes$(1) = "Hyperion mode!"
  367.     IF cpal = 3 THEN mes$(1) = "Do not adjust your set.  We control the horizontal and the vertical!"
  368. IF k = 32 THEN '                                                      cycle thru features
  369.     IF lock1 > 0 THEN '                                               on auto, landing zone selected, abort landing
  370.         abort = 1
  371.         mes$(0) = "ABORT!"
  372.         IF vx! = 0 THEN vx! = .01
  373.         RETURN
  374.     END IF
  375.     IF convo THEN '                                                   or speed up rendesvous
  376.         sct! = .2
  377.         sc! = TIMER
  378.         RETURN
  379.     END IF
  380.  
  381.     IF skyoff THEN tmod = t ELSE tmod = 16
  382.     jf = (jf + 1) MOD tmod
  383.     '          01234567890123456
  384.     i$ = MID$("mtsiHg5wleObBWoR", jf + 1, 1) '                        cycle thru ground and sky features
  385.     k = ASC(i$)
  386.     IF demo AND (jf = 7) THEN i$ = "e" '                              skip LGM in demo, because it's on the grave
  387.  
  388. p = INSTR("RObBWo", i$) '                                             jump to CM, deathstar, etc.
  389. IF p AND (skyoff = 0) THEN p = p - 1: GOSUB GoSkyObject
  390.  
  391. IF i$ = "A" THEN
  392.     lam = lam XOR 1 '                                                 land at McDonalds
  393.     IF lam AND (auto = 0) THEN i$ = "a" '                             turn on autopilot
  394. IF i$ = "a" THEN '                                                    autopilot
  395.     abort = 0 '                                                       in case it was on
  396.     tfollow = 0
  397.     auto = auto XOR 1 '                                               toggle
  398.     IF auto AND (radarf = 0) THEN radarf = 2
  399.     IF auto = 0 THEN hover = 1 '                                      be nice, help user
  400.     pt! = TIMER '                                                     restart countdown
  401. IF i$ = "c" THEN GOSUB CutOrOutOfFuel
  402. IF i$ = "C" THEN doclock = doclock XOR 1
  403. IF i$ = "d" THEN dump = dump XOR 1 '                                  fuel
  404. IF i$ = "D" THEN restart = 1 '                                        restart with defaults
  405. IF (i$ = "E") AND (starstatus > 0) THEN '                             end of universe
  406.     IF eou = 0 THEN eou = -1 ELSE eou = eou + 1 '                     restart or speedup
  407. IF i$ = "F" THEN
  408.     fuel! = h
  409.     lockfuel = 1
  410. IF i$ = "f" THEN lockfuel = lockfuel XOR 1 '                          THIS cheat the GT40 had, using toggle switches!
  411. IF i$ = "G" THEN gstyle = (gstyle + 1) MOD 6 '                        ground style
  412. IF i$ = "h" THEN hover = hover XOR 1: apd = 1 '                       apd=autopilot disconnect warning
  413. IF i$ = "I" THEN
  414.     invincible = ABS(invincible) XOR 1
  415.     mes$(0) = "INVINCIBLE MODE " + OnOff$(invincible)
  416.     GOSUB ReadLM '                                                    to change thrusters
  417. IF i$ = "j" THEN
  418.     darkstars = (darkstars + 1) MOD 5
  419.     mes$(0) = "Deathstar rotation" + STR$(darkstars)
  420. IF i$ = "k" THEN '                                                    kill threats or, if none, shoot at ground feature
  421.     firel = 1 '                                                       fire laser
  422.     FOR z = 1 TO 20 '                                                 IBM shells
  423.         shd(z) = 1
  424.     NEXT z
  425. IF i$ = "L" THEN GetSurface -1 '                                      level ground
  426. IF (i$ = "M") AND ((contact + inpause) = 0) THEN '                    laser level & land
  427.     magic = magic + 1
  428. IF (i$ = "n") AND inpause THEN nation = ((nation - 1) XOR 1) + 1 '    flag 1 US, 2 USSR
  429. IF i$ = "p" THEN GOSUB pause '                                        pause LM movement
  430. IF (i$ = "P") AND (contact = 0) AND (warp! < 1) AND (paraf = 0) THEN
  431.     paraf = 1 '                                                       parachute!
  432.     chs = 0
  433.     a = 0
  434.     GOSUB CutOrOutOfFuel
  435. IF i$ = "q" THEN Quit
  436. IF i$ = "Q" THEN
  437.     oscar = oscar XOR 1 '                                            land or sea flags for LGM
  438.     IF oscar THEN z$ = "SEA" ELSE z$ = "LAND"
  439.     mes$(0) = "LGM flags: " + z$
  440. IF i$ = "r" THEN
  441.     IF cut THEN '                                                     restart engine
  442.         cut = 0
  443.         hover = 1
  444.         power = opower
  445.         powerloss = 0
  446.     ELSE
  447.         IF auto = 0 THEN
  448.             radarf = (radarf + 1) MOD 3
  449.             mes$(0) = "Radar " + MID$("OFFON FAT", radarf * 3 + 1, 3)
  450.         END IF
  451.     END IF
  452. IF i$ = "S" THEN MakeSur: restart = 1 '                               generate new surfaces
  453. IF i$ = "T" THEN jitter = jitter XOR 1 '                              thrust computation
  454. IF i$ = "u" THEN '                                                    instrument panel on/off
  455.     zz = gs
  456.     gs = (SGN(gs) XOR 1) * 85 '                                       graphics start
  457.  
  458.     panelinit = 0
  459.     pif = -1
  460.  
  461.     z = (gs + 30) - px!
  462.     IF (gs > 0) AND (z > 0) THEN
  463.         px! = px! + z
  464.         suri = suri - z
  465.         GOSUB slimit
  466.     END IF
  467. IF i$ = "v" THEN '                                                    vertical automatic
  468.     IF tfollow THEN
  469.         tfollow = 0
  470.         mes$(0) = "TERRAIN FOLLOWING OFF"
  471.     END IF
  472.     vert = vert XOR 1
  473.     apd = 1 '                                                         autopilot disconnect warning
  474. IF i$ = "x" THEN starinit = 0: starfiles = (starfiles + 1) MOD 3 '    star density
  475. IF i$ = "X" THEN starinit = 0: regen = 1: Stars '                     regenerate single star file
  476. IF i$ = "y" THEN
  477.     mouseswap = mouseswap XOR 1
  478.     IF mouseswap THEN z$ = "reversed" ELSE z$ = "normal"
  479.     mes$(0) = "Mouse buttons " + z$
  480. IF i$ = "Y" THEN min = 3: sec = 45 '                                  black hole at 3:50
  481. IF (i$ = "z") AND (crash = 0) THEN
  482.     mes$(0) = "" '
  483.     mes$(1) = "" '                                                    erase radiation messages
  484.     dead$ = "SELF-DESTRUCT"
  485.  
  486. IF i$ = "}" THEN
  487.     GOSUB CutOrOutOfFuel
  488.     sgs = gs: gs = 0
  489.     srf = radarf: radarf = 0
  490.     GOSUB Plotscreen
  491.     dissolve
  492.     dead$ = " "
  493.     gs = sgs: radarf = srf
  494.  
  495. '          1234567890
  496. p = INSTR("5wlemtsiHg", i$) '                                         jump to feature
  497. IF p AND (contact = 0) THEN
  498.     sf = p
  499.     IF demo AND sf = 9 THEN sf = t
  500.     IF (sf(sf, 1) >= suri) AND (sf(sf, 0) < (suri + q3)) THEN '       already in vicinity of IBM
  501.         IF sf = 8 THEN shoot = 1 '                                    tell IBM to fire
  502.         IF demo THEN '                                                IBM at special location in demo mode, deal with it
  503.             px! = sf(sf, 2) - 3130
  504.             suri = 3130
  505.         END IF
  506.     ELSE
  507.         px! = center '                                                move ship to screen center
  508.         suri = sf(sf, 0) - center - 30 - (sf = 9) * h '               move ground to IBM
  509.     END IF
  510.     a = -ma '                                                         angle = -malfunction angle
  511.     abort = 0
  512.     wa = -ma '                                                        want angle
  513.     lock1 = 0 '                                                       radar lock
  514.     tmt! = 0 '                                                        to move total
  515.     vx! = 0 '                                                         not moving
  516.     warp! = 0 '                                                       cancel warp
  517. GOTO endk '                                                           done with ordinary keys
  518.  
  519. is2: '                                                                extended key
  520. z = mdelay '                                                          master delay
  521. mdelay = mdelay - (k = 73) + (k = 81) '                               PgUp/PgDn
  522. IF mdelay < 1 THEN mdelay = 1
  523. IF mdelay <> z THEN '                                                 changed
  524.     mes$(0) = "_LIMIT " + OnOff$(SGN(mdelay))
  525.     IF mdelay THEN mes$(0) = mes$(0) + LTRIM$(STR$(mdelay))
  526. IF status AND 3 THEN '                                                left or right shift
  527.     IF k = 72 THEN k = 201 '                                          LM up
  528.     IF k = 75 THEN k = 203 '                                          LM left
  529.     IF k = 77 THEN k = 204 '                                          LM right
  530. IF (inpause = 0) AND ((k = 72) OR (k = 80)) THEN '                    up and down arrow
  531.     apd = 1 '                                                         autopilot disconnect
  532.     hover = 0
  533.     vert = 0
  534.     thrust! = thrust! + (k = 80) - (k = 72) '                         true = -1
  535. thrust! = INT(thrust! * t) / t '                                      t = 10
  536. IF (hover = 0) AND (vert = 0) THEN thrust! = INT(thrust!)
  537. IF thrust! > h THEN thrust! = h
  538. IF (dump = 0) AND (fuel! > 0) AND (contact = 0) THEN '                side thrust/angle
  539.     IF inpause = 0 THEN wa = a - (k = 75) + (k = 77) '                                    left/right arrows
  540.     IF ABS(wa) > 99 THEN wa = 99 * SGN(wa) '                          want angle, limit 99
  541.     IF a <> wa THEN apd = 1 '                                         autopilot disconnect
  542. IF k = 59 THEN '                                                      F1 help
  543.     mHelp
  544.     start1! = TIMER: mpass& = 0 '                                     reset speed timer
  545. IF k = 60 THEN '                                                      F2 demo
  546.     demo = demo XOR 1
  547.     GOSUB init2
  548.     cbh = demo '                                                      constant black holes
  549. IF k = 61 THEN '                                                      F3, sky feature toggle
  550.     skyoff = skyoff XOR 1
  551.     IF skyoff = 0 THEN convo = 0
  552.     mes$(0) = "SKY OBJECTS " + OnOff$(1 - skyoff)
  553. IF k = 62 THEN '                                                      F4 endless bh
  554.     cbh = cbh XOR 1
  555.     exv(3) = 0
  556.     mes$(0) = "CONSTANT BLACK HOLES " + OnOff$(cbh)
  557. IF k = 63 THEN '                                                      F5 instrument background
  558.     f5toggle = f5toggle XOR 1
  559.     IF f5toggle = 0 THEN background = background XOR 1
  560.     IF f5toggle = 1 THEN porb = porb XOR 1
  561.     pload = 0
  562. IF (k = 64) AND ((ASO + inpause) = 0) THEN '                          F6 seperate AS/DS
  563.     GOSUB liftoff
  564.     RETURN
  565. IF k = 65 THEN showmap = showmap XOR 1 '                              F7 map
  566. IF k = 66 THEN '                                                      F8 shields
  567.     shield = shield XOR 1
  568.     geof = shield * t
  569. IF k = 67 THEN '                                                      F9 LED color
  570.     z$ = RIGHT$("0" + LTRIM$(STR$(LEDc)), 2)
  571.     z = INSTR(LED$, z$): IF z = 11 THEN z = -1
  572.     LEDc = VAL(MID$(LED$, z + 2, 2))
  573.     LEDtri = 0
  574. IF k = 68 THEN '                                                      F10 LED tri-color
  575.     LEDtri = LEDtri XOR 1
  576.     IF LEDtri THEN LEDc = green
  577. IF k = 71 THEN rmin = 0: dmin = 0: starinit = 0 '                     Home, star RA/dec to 0
  578.  
  579. endk:
  580. IF k = 201 THEN hoverc = hoverc - t '                                 move up
  581. IF k = 203 AND (left = 0) THEN left = 16 '                            move left
  582. IF k = 204 AND (right = 0) THEN right = 16 '                          move right
  583. IF apd OR (k = 201) OR (k = 203) OR (k = 204) THEN '                  blink AUTO
  584.     IF auto THEN APdisengage = 20 '                                   blink 20 times
  585.     auto = 0 '                                                        turn it off
  586.     apd = 0 '                                                         reset flag
  587.  
  588. pause:
  589. IF inpause THEN RETURN '                                              already doing this....
  590. dead$ = ""
  591. inpause = 1
  592. pt! = TIMER '                                                         for demo mode
  593. wu! = pt! + 1 '                                                       delay before planting flag
  594. DO: _LIMIT mdelay
  595.     GOSUB KeyAndMouse
  596.     IF k = 60 THEN RETURN '                                           F2 demo
  597.     IF (i$ > "") AND (INSTR("zD", i$)) THEN RETURN '                  self-destruct or restart
  598.     GOSUB Plotscreen
  599.     IF LEN(dead$) THEN RETURN
  600.     IF auto AND contact THEN '                                        countdown to blast off
  601.         IF TIMER < pt! THEN pt! = TIMER '                             midnite crossing fix
  602.         z! = TIMER - pt!
  603.         z = t - z!
  604.         IF z < 0 THEN z = 0
  605.         TextOnLM$ = LTRIM$(STR$(z))
  606.         IF z! > t THEN i$ = CHR$(13) '                                like pressing the key
  607.     END IF
  608.     GOSUB CalcFuel
  609. LOOP UNTIL (i$ = CHR$(13)) OR (i$ = "p")
  610. ctime! = TIMER
  611. fb$ = "" '                                                            feedback
  612. inpause = 0
  613. c = (contact = 1) AND (crash = 0) AND (liftoff = 0) AND (ABS(a) < 31)
  614. IF c THEN GOSUB liftoff
  615.  
  616. CalculateMotion:
  617. i = 0
  618. IF (power = opower) AND (RND < .0003) THEN
  619.     i = ((auto + contact + liftoff + vert) = 0) AND ((min * 60 + sec) > t)
  620. IF fpl OR i THEN '                                                    force power loss
  621.     fpl = 0
  622.     powerloss = t + RND * t + ASO * 30 '                              10 TO 20%, 50% ASO
  623.     power = opower + powerloss / h * opower
  624.     mes$(0) = LTRIM$(STR$(powerloss)) + "% POWER LOSS - DUMP FUEL!"
  625.  
  626. IF lob THEN px! = px! + exv(2) '                                      landed on Borg
  627. IF contact OR inpause THEN GOTO other
  628.  
  629. ta = ((a + ma) + 270) MOD tsix '                                       temp angle = a+malfunction angle
  630. ma! = (vmass + fuel!) / th '                                          actually 54% fuel
  631. fo! = ((thrust! + super * 5) / ma!) / power '                         f = ma
  632. IF fuel! = 0 THEN fo! = 0 '                                           nix any force if running on empty
  633. fx! = fo! * c!(ta) / 2
  634. IF dump AND (ABS(a) < 5) THEN fx! = 0
  635. fy! = fo! * s!(ta) + grav! '                                          thrust + gravity
  636. IF warp! > 0 THEN fx! = fx! * (warp! * 2 + 1) '                       get thru warp msgs faster
  637. vx! = vx! - fx!
  638. IF a <> 0 THEN vx! = vx! + (RND - pf!) / h '                          help get to integer vx
  639. IF ABS(vx!) < .01 THEN vx! = 0
  640. avx = ABS(vx!)
  641. IF (avx > 5) AND (avx < 20) THEN xoff = vx! ELSE xoff = 0
  642. IF cut AND (magic = 0) THEN
  643.     cel! = TIMER - ctime! '                                           time since cut
  644.     vy! = cvy! + grav! * (cel! * cel!) '                              v = at^2  velocity = acceleration times time squared
  645.     fy! = 0 '                                                         null y force since it's a different situation
  646. vy! = vy! + fy!
  647. IF warp! >= 1 THEN vy! = 0
  648.  
  649. px! = px! + vx! - lob * exv(2)
  650. py! = py! + vy!
  651.  
  652. IF (liftoff = 0) AND (py! < 55) THEN '                                stop going off screen top
  653.     IF convo = 0 THEN mes$(0) = "Too high - reduce thrust!"
  654.     py! = 55
  655.     vy! = 0
  656.  
  657. other:
  658. GOSUB CalcFuel
  659. IF liftoff AND (lob = 0) THEN RETURN
  660. nomove = demo AND (((suri \ q3) + 1) = 5)
  661.  
  662. zz = px! - center
  663. z! = ABS(vx!)
  664.  
  665. IF (nomove = 0) AND ((rlink > 0) OR (z! < 3) OR (z! > 20)) THEN
  666.     dx! = px! - center
  667.     px! = center
  668.     tmt! = tmt! + dx!
  669.     zq = 0 '                                                          was 30 woof woof
  670.     c1 = (px! <= (gs + zq))
  671.     c2 = (px! >= (q3 - zq))
  672.     IF c1 OR c2 THEN
  673.         IF c1 THEN z = q3 - zq ELSE z = gs + zq
  674.         z = z - px!
  675.         tmt! = tmt! - z
  676.         px! = px! + z
  677.     ELSEIF (zz <> 0) AND (ABS(vx!) <= 5) AND (nomove = 0) THEN
  678.         z = zz \ 2 + 1
  679.         tmt! = tmt! + z
  680.         px! = px! - z
  681.     END IF
  682. IF ABS(tmt!) >= q3 THEN tmt! = SGN(tmt!) * q3 - 1
  683.  
  684. IF left THEN '                                                        jog left (shift left arrow)
  685.     IF left = 16 THEN sv! = vx!
  686.     IF left > 8 THEN a = 4 ELSE a = -4
  687.     left = left - 1
  688.     IF left = 0 THEN a = 0: vx! = sv!
  689. IF right THEN '                                                       jog right (shift right arrow)
  690.     IF right = 16 THEN sv! = vx!
  691.     IF right > 8 THEN a = -4 ELSE a = 4
  692.     right = right - 1
  693.     IF right = 0 THEN a = 0: vx! = sv!
  694.  
  695. CalcFuel:
  696. IF cut THEN thrust! = 0
  697. IF lockfuel = 0 THEN
  698.     ta = ABS(a): IF ta > 5 THEN ta = 5 '                              main angle, up to 5
  699.     z! = (ta + super + ABS(fst)) * t '                                plus 10% for thrusters
  700.     used! = (thrust! + z!) / 8000
  701.     IF ASO THEN used! = used! * 2 '                                   burn faster for AS
  702.     IF inpause THEN used! = 0
  703.     IF shield THEN used! = used! + .001
  704.     fuel! = fuel! - used! * 4
  705.     IF fuel! <= 0 THEN fuel! = 0: GOSUB CutOrOutOfFuel
  706.  
  707. Plotscreen:
  708. IF bit! = 0 THEN bit! = TIMER + pf!
  709. IF TIMER > bit! THEN
  710.     bbit = bbit XOR 1 '                                               toggles twice per second, used all over - instruments, IBM hazard lights, clock colon, LGM ear wiggle
  711.     bit! = 0
  712.  
  713. bolthit = 0
  714. bolthitf = 0
  715. IF (crash = 0) AND (ABS(vx!) >= h) THEN warp! = ABS(vx!) / h ELSE warp! = 0
  716. IF warp! >= 1 THEN paraf = 0 '                                        reckon parachute can be dropped at warp speeds
  717.  
  718. ' change styles every 10/30 seconds
  719. IF style! = 0 THEN style! = TIMER + t
  720. IF style! > 86400 THEN style! = 1 '                                   midnite xing
  721. IF TIMER > style! THEN
  722.     bstyle1 = (bstyle1 + 1) MOD 3 '                                   Borg guts every 10s
  723.     IF bstyle1 = 0 THEN bstyle2 = bstyle2 XOR 1 '                     Borg exhaust
  724.     style! = 0
  725.  
  726. IF (starstatus > 0) AND (eou = 0) AND (vert = 0) AND (RND > .9999) THEN '  stars on+not already falling+WHY?+rarely
  727.     mes$(0) = "THE SKY IS FALLING!  THE SKY IS FALLING!"
  728.     eou = 1
  729. GOSUB CalculateMotion
  730.  
  731. IF gs THEN '                                                          graphics start not 0, instruments are visible
  732.     VIEW
  733.     pif = (pif + 1) MOD (pdiv + 1)
  734.     IF pif THEN timemachine ELSE GOSUB Instruments '                  INSTRUMENTS
  735. IF starstatus THEN
  736.     VIEW SCREEN(gs, SGN(LEN(mes$(0))) * 20)-(q3, q4)
  737.     Stars '                                                           STARS
  738.     VIEW SCREEN(gs, 0)-(q3, q4)
  739.     VIEW SCREEN(gs, 0)-(q3, q4)
  740.     CLS
  741.  
  742. IF LEN(mes$(0)) THEN
  743.     VIEW SCREEN(gs, 0)-(q3, 20)
  744.     CLS
  745.     VIEW SCREEN(gs, 0)-(q3, q4)
  746.  
  747. Info '                                                                INFO show timed messages at top, if any
  748. IF warp! < 1 THEN '                                                   no sky features except star streaks at warp speeds
  749.     IF skyoff = 0 THEN GOSUB SkyStuff '                               CM/DS/Bo/BH/Wo/Co
  750.     GOSUB PlotGround '                                                GROUND/FEATURES
  751.     Shells '                                                          SHELLS
  752.     IF (invincible = 0) AND (shield = 0) AND (skyoff = 0) THEN GOSUB FiveWaysToDie
  753. IF platform THEN PUT (pminx, pminy), gbuff(), OR '                    falling descent stage
  754. IF LEN(dead$) = 0 THEN GOSUB PlotVehicle '                            VEHICLE
  755. IF (warp! < 1) AND showmap AND (crash = 0) THEN
  756.     VIEW
  757.     Map '                                                             LM, ground & sky features
  758.     VIEW SCREEN(gs, 0)-(q3, q4)
  759. IF bolthit THEN '                                                     lightning zap from Deathstar
  760.     boltc = boltc + 1 + (boltc = 9999)
  761.     rtl!(2) = TIMER + 5
  762.     rtlc(2) = boltc
  763.     IF ((invincible + shield) = 0) AND (boltc >= t) THEN dead$ = "Zapped!" '   by EPCOR!"
  764.  
  765. IF okrick AND (LEN(debug$) > 0) THEN LOCATE 1, 12: PRINT debug$;
  766. timemachine
  767.  
  768.  
  769. SkyStuff:
  770. IF (min = 3) AND (sec = 50) THEN '                                    Tree-fiddy! (Southpark), do black hole
  771.     ex(3) = suri + t
  772.     ey(3) = h
  773.     exv(3) = t
  774.     eyv(3) = 1
  775.  
  776. IF cmleaving THEN
  777.     exv(0) = exv(0) + 2
  778.     IF exv(0) = 0 THEN exv(0) = 1
  779.  
  780. RESTORE skycrud
  781. IF eou THEN mi = 2 ELSE mi = 5 '                                      end of universe, no celestial events
  782. FOR i = 0 TO mi '                                                     0CM 1DS 2Borg 3BH 4Worm 5Comet 6Al
  783.     READ g$, skyset1(i), skyset2(i)
  784.  
  785. FOR i = 0 TO mi + ufof '                                              0CM 1DS 2Borg 3BH 4Worm 5Comet 6Alien
  786.     xplus = skyset1(i): xminus = skyset2(i)
  787.     IF (i = 3) AND cbh THEN ek(i) = 0 '                               constant black hole
  788.     IF ek(i) = -1 THEN GOTO ni2
  789.  
  790.     IF (ey(i) > (q4 + 50)) OR (ey(i) < -50) OR (exv(i) = 0) THEN
  791.         ei(i) = 0 '                                                   ini
  792.         ek(i) = 9999
  793.         nx:
  794.         ex(i) = RND * q1
  795.         IF ABS(ex(i) - (px! + suri)) < q3 THEN GOTO nx '              start away from craft
  796.         IF ABS(ex(i) - px!) < q3 THEN GOTO nx '                       start away from craft
  797.         IF i = 2 THEN ex(i) = (ex(1) + 3200) MOD q1
  798.         ey(i) = 120 + RND * h '                                       random y 120-220
  799.         IF i = 0 THEN ey(i) = 22 '                                    CM
  800.         IF i = 1 THEN ey(i) = 170 '                                   DS
  801.         IF i = 2 THEN ey(i) = th '                                    Borg
  802.         '              0 1 2 3 4 5
  803.         '              CMDeBoBHWoCoAl
  804.         c1 = VAL(MID$("04010210120502", i * 2 + 1, 2)) '              min x velocity
  805.         c2 = VAL(MID$("09030210171005", i * 2 + 1, 2)) '              max x velocity
  806.         exv(i) = RND * (c2 - c1) + c1 '                               random in range
  807.         IF RND > pf! THEN exv(i) = -exv(i)
  808.  
  809.         z = VAL(MID$("00000003020100", i * 2 + 1, 2)) '               top range y velocity
  810.         eyv(i) = 0
  811.         IF z THEN eyv(i) = RND * (z - 1) + 1 '                        random in range
  812.  
  813.         IF RND > pf! THEN exv(i) = -exv(i)
  814.         IF RND > pf! THEN eyv(i) = -eyv(i)
  815.         IF (i = 3) AND cbh THEN
  816.             IF RND > pf! THEN
  817.                 ex(i) = suri - t
  818.                 exv(i) = t
  819.             ELSE
  820.                 ex(i) = suri + q3 + t
  821.                 exv(i) = -t
  822.             END IF
  823.         END IF
  824.     END IF
  825.  
  826.     ex(i) = ex(i) + exv(i)
  827.     ey(i) = ey(i) + eyv(i)
  828.  
  829.     IF ex(i) < 0 THEN
  830.         IF (i = 0) AND cmleaving THEN
  831.             ek(i) = -1: cmleaving = 0
  832.         ELSE
  833.             ex(i) = ex(i) + q1
  834.         END IF
  835.     END IF
  836.     IF ex(i) > q1 THEN
  837.         IF (i = 0) AND cmleaving THEN
  838.             ek(i) = -1: cmleaving = 0
  839.         ELSE
  840.             ex(i) = ex(i) - q1
  841.         END IF
  842.     END IF
  843.  
  844.     exl(i) = localize(ex(i), xplus, xminus)
  845.     IF (i = 3) AND cbh AND (exl(i) = 9999) THEN exv(i) = 0
  846.  
  847.     IF ek(i) <> -1 THEN ek(i) = 9999
  848.     IF exl(i) <> 9999 THEN
  849.         dx! = ABS(px! - exl(i))
  850.         dy! = ABS(py! - ey(i))
  851.         ek(i) = SQR(dx! * dx! + dy! * dy!)
  852.  
  853.         IF i = 0 THEN GOSUB CommandModule
  854.         IF i = 1 THEN DeathStar exl(i), f$(37)
  855.         IF i = 2 THEN Borg exl(i), ey(i)
  856.         IF i = 3 THEN
  857.             IF (LEN(mes$(0)) = 0) AND (showmap = 0) AND (cbh = 0) THEN
  858.                 mes$(0) = "DANGER, WILL ROBINSON, DANGER!"
  859.             END IF
  860.             IF sas = 0 THEN BlackHole 0
  861.             sas = 0
  862.         END IF
  863.         IF i = 4 THEN WormHole
  864.         IF i = 5 THEN
  865.             tx = localize(ex(5), 0, 0)
  866.             ty = ey(5)
  867.             Comet tx, ty
  868.         END IF
  869.         IF i = 6 THEN '                                               traditional alien - too silly
  870.             j = RND * h - h \ 2
  871.             z = ey(6) + j
  872.             IF (RND > .9) AND (z > h) AND (z < 250) THEN
  873.                 ey(6) = z
  874.                 alien = alien XOR 1
  875.                 ex(6) = ex(6) + 20 * SGN(alien - pf!)
  876.             END IF
  877.             UFO exl(6), ey(6), exv(6)
  878.         END IF
  879.     END IF
  880.     ni2:
  881.  
  882. FiveWaysToDie:
  883. IF (ek(2) >= 0) AND (ek(2) < 20) THEN '                               Borg
  884.     wu! = TIMER + 5
  885.     DO: _LIMIT mdelay
  886.         CLS
  887.         mes$(0) = "YOU ARE BORG"
  888.         Info
  889.         Borg exl(2), ey(2)
  890.         FOR i = 1 TO rp
  891.             p = POINT(LMrx(i), LMry(i))
  892.             IF p = black2 THEN c = green ELSE c = black2
  893.             PSET (LMrx(i), LMry(i)), c
  894.         NEXT i
  895.         timemachine
  896.     LOOP UNTIL TIMER > wu!
  897.     dead$ = "BORG"
  898.  
  899. IF (ek(3) >= 0) AND (ek(3) < 30) THEN '                               black hole
  900.     dead$ = "EATEN"
  901.     BlackHoleDoom
  902.  
  903. IF (ek(4) >= 0) AND (ek(4) < 30) THEN '                               wormhole
  904.     wu! = TIMER + 5
  905.     spx! = exl(4)
  906.     spy! = ey(4)
  907.     exv(4) = 0
  908.     eyv(4) = 0
  909.     wradar = radarf
  910.     radarf = 1
  911.     cut = 1
  912.     DO: _LIMIT mdelay
  913.         CLS
  914.         fb$ = ""
  915.         mes$(0) = "HOLY CRAP, BATMAN!"
  916.         mes$(1) = ""
  917.         Info
  918.         a = RND * 359
  919.         px! = spx! + (RND - pf!) * 20
  920.         py! = spy! + (RND - pf!) * 5
  921.         WormHole
  922.         LMdistort '                                                   optional
  923.         GOSUB PlotVehicle
  924.         timemachine
  925.     LOOP UNTIL TIMER > wu!
  926.     radarf = wradar
  927.     dead$ = "BATMAN"
  928.  
  929. IF (ek(5) >= 0) AND (ek(5) < 15) THEN dead$ = "HIT BY COMET"
  930. IF ufof AND (ek(6) >= 0) AND (ek(6) < 45) THEN dead$ = "HIT BY ALIEN"
  931.  
  932. GetAlt:
  933. alt! = (gety(-(rxm + wi2)) - ((sy1 + sy2) \ 2)) / 5
  934.  
  935. Instruments:
  936. osc = 8
  937. IF gs THEN LoadPanel '                                                graphics start not zero, instrument panel is on
  938. IF (warp! > 0) AND (contact = 0) THEN
  939.     IF warp! >= t THEN
  940.         dead$ = "WARP 10"
  941.         RETURN
  942.     END IF
  943.     RESTORE warp
  944.     FOR i = 1 TO INT(warp!)
  945.         READ z$
  946.     NEXT i
  947.     w$ = LTRIM$(STR$(INT(warp! * h) / h))
  948.     IF LEN(w$) = 1 THEN w$ = w$ + ".00"
  949.     IF LEN(w$) = 3 THEN w$ = w$ + "0"
  950.     mes$(0) = "WARP " + w$ + " - " + z$
  951.     IF gs AND ((TIMER MOD t) > 5) THEN
  952.         Henonp f
  953.         Wave '                                                        osc = 5 if commented out
  954.         AuHoVe auto, hover, vert, lam
  955.         GOTO clock
  956.     END IF
  957.  
  958. IF gs = 0 THEN RETURN '                                               graphics start of 0 means the instrument panel is off
  959.  
  960. IF panelinit = 0 THEN
  961.     IF crash THEN f = 15 ELSE f = ((f + 1) MOD 5) + t '               title graphic/face
  962.  
  963. Henonp f '                                                            title graphic
  964.  
  965. LINE (0, 0)-(gs - 1, 3), blue2, BF '                                  clear map area
  966.  
  967. IF pdiv THEN '                                                        instrument update frequency 1-4, mainly a way to slow down erratic thrust display
  968.     j = 0
  969.     FOR i = 1 TO 18 '                                                 my name in Morse
  970.         p = VAL(MID$("002032023222300032", i, 1)) '                   Frost
  971.         IF p < 3 THEN LINE (14 + j, 2)-(14 + j + p, 2), white
  972.         j = j + p + 2
  973.     NEXT i
  974.  
  975. IF (contact + auto + hover + vert + liftoff) = 0 THEN
  976.     IF (vy! > .6) AND (-fy! < 0) THEN PrintVGA CHR$(24), 5, 241, red, black2
  977.     IF (vy! < .4) AND (-fy! > -.01) THEN PrintVGA CHR$(25), 5, 250, yellow, black2
  978.  
  979. AuHoVe auto, hover, vert, lam
  980.  
  981. IF tfollow THEN '                                                     terrain following!
  982.     FOR ty = glmax - 20 TO glmax
  983.         FOR tx = 0 TO gs - 1
  984.             IF POINT(tx, ty) = blue THEN PSET (tx, ty), red '         red bg
  985.         NEXT tx
  986.     NEXT ty
  987.     FOR i = 0 TO 4 '                                                  TF
  988.         p& = VAL("&H" + MID$("E744464444", i * 2 + 1, 2))
  989.         LINE (2, 339 + i)-(10, 339 + i), green, , p& * 128
  990.     NEXT i
  991.  
  992. osc = 0
  993. c = LEDc
  994. IF (sbest! >= h) OR powerloss THEN c = red
  995. z! = thrust!: IF z! > h THEN z! = h '                                 200 at liftoff, show 100
  996. PrepAndShowLED z!, 3, 1 '                                             thrust osc1
  997. PrintCGA "T", 5, -1, c, -blue, 0 '                                    T is for flame
  998. i = LEDc: j = black
  999. IF jitter THEN SWAP i, j '                                            thrust calc type
  1000. LINE (4, 231)-(5, 232), i, B '                                        left light  (on = slow)
  1001. LINE (13, 231)-(14, 232), j, B '                                      right light (on = fast)
  1002. Bar z! / h, 0
  1003.  
  1004. c = dcolor(vy!, 2, 3, 1) '                                            vy osc2
  1005. z! = vy!
  1006. IF ABS(z!) > 99.97 THEN z! = 99.99
  1007. PrepAndShowLED z!, 3, 2
  1008. PrintCGA "V", 5, -1, c, -blue2, 0
  1009. z! = (z! + 3) / 6
  1010. Bar z!, 1
  1011.  
  1012. c = dcolor(vx!, 2, 3, 1) '                                            vx osc3
  1013. IF warp! THEN
  1014.     z! = warp!
  1015.     z! = vx! + rfs!
  1016. PrepAndShowLED z!, 3, 2
  1017. PrintCGA "H", 5, -1, c, -blue, 0
  1018. z! = (z! + 3) / 6
  1019. Bar z!, 1
  1020.  
  1021. GOSUB GetAlt '                                                        alt osc4
  1022. IF contact AND (alt! > 0) THEN alt! = 0
  1023. c = dcolor(alt!, t, 3, -1)
  1024. PrepAndShowLED alt!, 4, 1
  1025. PrintCGA "A", 5, -1, c, -blue2, 0
  1026. IF warp! OR (radarf = 0) THEN z! = 0 ELSE z! = alt! / 60
  1027. Bar z!, 0
  1028.  
  1029. c = dcolor(fuel!, t, 5, -1) '                                         fuel osc5
  1030. PrepAndShowLED fuel!, 4, 1
  1031. PrintCGA "F", 5, -1, c, -blue, 0
  1032. z! = fuel! / h
  1033. Bar z!, 0
  1034.  
  1035. clock:
  1036. IF TIMER < start2! THEN start2! = TIMER '                             midnite crossing
  1037. IF crash = 0 THEN el! = el! + (TIMER - start2!) '                     elapsed time
  1038. start2! = TIMER
  1039. IF el! >= 1 THEN
  1040.     WHILE el! >= 1 '                                                  catch-up
  1041.         el! = el! - 1
  1042.         sec = (sec + 1) MOD 60
  1043.         IF sec = 0 THEN min = (min + 1) MOD 99
  1044.     WEND
  1045.     IF sec MOD 5 = 0 THEN '                                           change title graphic
  1046.         IF crash THEN f = 15 ELSE f = ((f + 1) MOD 5) + t
  1047.     END IF
  1048. z$ = RIGHT$("0" + LTRIM$(STR$(min)), 2) + RIGHT$("0" + LTRIM$(STR$(sec)), 2)
  1049. osc = 6
  1050. LEDdisplay z$ '                                                       clock osc6
  1051.  
  1052. i = suri + px!
  1053. j = ABS(i - sf(5, 2))
  1054. k = sf(5, 2) + (q1 - i)
  1055. IF j <= 3200 THEN dtm! = j ELSE dtm! = k
  1056. PrepAndShowLED dtm!, 4, 0 '                                           dtm osc7
  1057. PrepAndShowLED CSNG(speed), 4, 0 '                                    speed osc8
  1058. ShowAngle a '                                                         angle osc9
  1059. panelinit = 1
  1060.  
  1061. LMcolors: '                                                           optional
  1062. IF contact OR (vx! = 0) THEN lbit = 0
  1063. IF (contact + vx!) = 0 THEN
  1064.     v1 = RND * 3
  1065.     v2 = RND * 3
  1066.     SWAP LMci(v1), LMci(v2)
  1067. FOR i = 1 TO rp '                                                     right pad
  1068.     oc = LMoc(i)
  1069.     LMc(i) = oc
  1070.     IF (oc = craft) OR (oc = red) THEN '                              shadow
  1071.         zx = LMrx(i) - px! + 2 - xoff * (inpause = 0)
  1072.         zy = LMry(i) - py!
  1073.         IF (oc = craft) AND ((warp! > 0) OR (zy > zx)) THEN
  1074.             tc = gray2
  1075.         ELSE
  1076.             tc = oc
  1077.         END IF
  1078.         LMc(i) = tc
  1079.     END IF
  1080.     IF (i < 279) AND (LMoc(i) = black2) THEN '                        Ascent stage cycle
  1081.         lbit = (lbit + 5) MOD 4
  1082.         LMc(i) = LMci(lbit)
  1083.     END IF
  1084. lbit = lbit - (vx! > 0) * 2 + ASO * t
  1085.  
  1086. PlotVehicle:
  1087. IF warp! < 1 THEN
  1088.     wda = 0
  1089.     px! = wx!: py! = wy!
  1090.     wda = warp! * 5 * s!((px! + 40) MOD tsix)
  1091.  
  1092. IF crash THEN
  1093.     FOR i = 1 TO rp
  1094.         PSET (LMrx(i), LMry(i)), LMc(i)
  1095.     NEXT i
  1096.     GOTO endproc
  1097.  
  1098. IF bolthit = 0 THEN GOSUB LMcolors
  1099.  
  1100. i = sf(4, 2) - 50 '                                                   left of volcano
  1101. j = sf(4, 2) + 50 '                                                   right of volcano
  1102. k = suri + px! '                                                      LM position
  1103. IF (k > i) AND (k < j) THEN '                                         in the locality?
  1104.     c = 0 '                                                           count
  1105.     FOR ty = py! + 8 TO py! + 18 '                                    leg/nozzle area
  1106.         FOR tx = px! - 17 TO px! + 17
  1107.             p = POINT(tx, ty) '                                       what color is the pixel?
  1108.             c = c - (p = orange) '                                    hot lava
  1109.         NEXT tx
  1110.     NEXT ty
  1111.     ' LINE (px! - 17, py! + 8)-(px! + 17, py! + 18), yellow, B '      diagnostics
  1112.     IF c THEN '                                                       contacted some lava
  1113.         FOR i = rp TO 1 STEP -1 '                                     from the bottom
  1114.             IF LMoc(i) = craft THEN '                                 is normal color?
  1115.                 LMoc(i) = red '                                       make red
  1116.                 nred = nred + 1 '                                     keep track of count
  1117.                 c = c - 1
  1118.                 IF c = 0 THEN EXIT FOR '                              enough
  1119.             END IF
  1120.         NEXT i
  1121.     END IF
  1122.  
  1123. IF nred = 0 THEN '                                                    number red
  1124.     temp = 0
  1125.     rtlc(1) = 0
  1126.     IF ASO THEN z = 115 ELSE z = 223 '                                max that COULD be normal
  1127.     otemp = temp
  1128.     temp = (nred * h / z) MOD 101 '                                   temperature
  1129.     rtlc(1) = temp
  1130.     IF temp > otemp THEN rtl!(1) = TIMER + 5
  1131.     c = 24 '                                                          gasoline
  1132.     IF temp > 30 THEN c = 32 '                                        dark red
  1133.     IF temp > 60 THEN c = 4 '                                         red
  1134.     IF temp = h THEN c = 15 '                                         white
  1135.     IF bw = 0 THEN PALETTE gasoline, c
  1136.     IF (temp = h) AND (invincible = 0) THEN dead$ = "FRIED BY VOLCANO"
  1137.     FOR i = 0 TO 20 '                                                 cool down some
  1138.         j = RND * rp
  1139.         IF LMoc(j) = red THEN LMoc(j) = craft: nred = nred - 1
  1140.     NEXT i
  1141.  
  1142. n = rp '                                                              last pixel = right pad
  1143. IF fuel! > 0 THEN GOSUB Exhaust '                                     maybe vehicle only
  1144.  
  1145. IF n > maxn THEN maxn = n
  1146.  
  1147. ta = a + ma '                                                         temp a = a + malfunction
  1148. zz = ta * -(ABS(ta) > 4) '                                            rotate beyond 5 degrees
  1149. ta = (zz + wda + tsix) MOD tsix '                                             keep in array bounds
  1150. c! = c!(ta) '                                                         cosine
  1151. s! = s!(ta) '                                                         sine
  1152. ta = zz '                                                             angle to use
  1153.  
  1154. rfx = 0 '                                                             optional craft jitter
  1155. rfy = 0
  1156. rfs! = 0 '                                                            random change in vx
  1157. IF (jitter = 1) AND (cut = 0) THEN '                                  not slow or engine cut
  1158.     IF (RND > .9) AND (a = 0) THEN '                                  a = angle
  1159.         IF RND > pf! THEN rfx = 1 ELSE rfx = -1 '                     half right, half left
  1160.         rfs! = rfx * .01 * (INT(RND * 9) + 1) '                       how much? .01 - .09
  1161.     END IF
  1162.     IF RND > .9 THEN '                                                y jitter, 1 chance in 10
  1163.         IF RND > pf! THEN rfy = 1 ELSE rfy = -1 '                     half down, half up
  1164.     END IF
  1165.  
  1166. IF doclock THEN
  1167.     i = VAL(MID$(TIME$, 1, 2))
  1168.     j = VAL(MID$(TIME$, 4, 2))
  1169.     k = VAL(MID$(TIME$, 7, 2))
  1170.     clocka(0) = (i + j / 60) * 30 '                                   hour hand
  1171.     clocka(1) = j * 6 '                                               minute hand
  1172.     clocka(2) = k * 6 '                                               seconds
  1173.     FOR z = 0 TO 2 '                                                  prep for radians
  1174.         clocka(z) = (clocka(z) + 270) MOD tsix
  1175.     NEXT z
  1176.     ao = 0 '                                                          angle offset
  1177.     ao = (ao + 1) MOD 361
  1178.  
  1179. tvx = SGN(vx!): IF tvx = 0 THEN tvx = 1
  1180. tao = ao * tvx
  1181. sco = sco XOR 1
  1182. IF doclock THEN sco = 0
  1183. IF sco THEN tc = red ELSE tc = lmsl
  1184. z3 = tsix + (shield = 0) * 361
  1185. FOR z2 = 0 TO z3
  1186.     a2 = (z2 + tao * 5 + tsix0) MOD tsix
  1187.     tx = px! + 50 * c!(a2) * aspect!
  1188.     ty = py! + 50 * s!(a2)
  1189.     IF ty < gety(tx) THEN
  1190.         IF (z2 MOD 30) = 0 THEN
  1191.             CIRCLE (tx, ty), 1, tc, , , .75
  1192.             IF geof THEN
  1193.                 FOR i = z2 - 120 TO z2 STEP 30
  1194.                     j = (i + tsix) MOD tsix
  1195.                     tx2 = px! + 60 * c!(j) * aspect!
  1196.                     ty2 = py! + 60 * s!(j)
  1197.                     LINE (tx, ty)-(tx2, ty2), tc
  1198.                 NEXT i
  1199.             END IF
  1200.         END IF
  1201.         IF doclock THEN
  1202.             FOR i = 0 TO 2
  1203.                 IF a2 = clocka(i) THEN
  1204.                     c = VAL(MID$("021404", i * 2 + 1, 2))
  1205.                     CIRCLE (tx, ty), 4 - i, c, , , .75
  1206.                     PAINT (tx, ty), c, c
  1207.                 END IF
  1208.             NEXT i
  1209.         END IF
  1210.     END IF
  1211. NEXT z2
  1212.  
  1213. FOR i = 1 TO rp '                                                     rp = craft right pad
  1214.     LMrx(i) = px! + LMx(i) * c! + LMy(i) * s! + rfx '                 x rotated
  1215.     LMry(i) = py! - LMx(i) * s! + LMy(i) * c! + rfy '                 y rotated
  1216.     IF LMry(i) > glmax THEN LMry(i) = glmax '                         not below ground
  1217.     IF i = xp THEN sx0 = LMrx(i): sy0 = LMry(i) '                     save radar loc
  1218.     IF i = lp THEN sx1 = LMrx(i): sy1 = LMry(i) '                     save left pad loc
  1219.     IF i = rp THEN sx2 = LMrx(i): sy2 = LMry(i) '                     save right pad loc
  1220.     IF bolthit THEN LMc(i) = white
  1221.     PSET (LMrx(i), LMry(i)), LMc(i)
  1222.  
  1223. IF fuel! < 95 THEN GOSUB flevel
  1224.  
  1225. eflag = 0 '                                                           determine flame climb
  1226. fx1 = 0 ' initialize for deflect
  1227. fx2 = 0
  1228. phg = (sx1 + sx2) \ 2 + ta * 2 '                                      point hit ground
  1229.  
  1230. tty! = py! + 26
  1231.  
  1232. FOR i = rp + 1 TO n '                                                 flame/fuel dump
  1233.     x = px! + LMx(i) * c! + LMy(i) * s! + rfx '                       x rotated
  1234.     y = py! - LMx(i) * s! + LMy(i) * c! + rfy '                       y rotated
  1235.     c = LMc(i) '                                                      fuel dump/flame
  1236.     IF warp! < 1 THEN GOSUB deflect '                                 deflect off ground
  1237.     c = ABS(c) '                                                      color
  1238.     PSET (x, y), c '                                                  flame particle
  1239.     IF i <= n3 THEN '                                                 main exhaust
  1240.         IF (i MOD t) = 1 THEN '                                       every 10th pixel
  1241.             LINE (x - 1, y)-(x + 1, y), c '                           make "+"
  1242.             LINE (x, y - 1)-(x, y + 1), c
  1243.         END IF
  1244.     END IF
  1245.  
  1246. IF rfx AND dump AND (a = 0) THEN vx! = vx! + rfs! '                   make jitter real
  1247. IF rfx AND (dump = 0) AND (a <> 0) THEN vx! = vx! + rfs!
  1248.  
  1249. endproc:
  1250.  
  1251. IF doclock THEN TextOnLM$ = LEFT$(TIME$, 5)
  1252. IF LEN(TextOnLM$) THEN GOSUB TextOnLM
  1253.  
  1254. GOSUB radar
  1255.  
  1256. fc = 0 '                                                              LGM flame count
  1257. IF (sf(3, 1) >= suri) AND (sf(3, 0) < (suri + q3)) THEN
  1258.     x1 = sf(3, 0) - suri
  1259.     y1 = gety(x1) - 14
  1260.     FOR x = x1 + 5 TO x1 + 15
  1261.         FOR y = y1 - 9 TO y1 + 12
  1262.             IF POINT(x, y) = yellow THEN fc = fc + 1
  1263.         NEXT y
  1264.     NEXT x
  1265.  
  1266. GOSUB KillThreats
  1267.      
  1268. geof = geof - 1 - (geof = 0)
  1269.  
  1270. IF ok AND (TIMER > wu2!) AND (INSTR(mes$(0), "IN CAR") = 0) THEN FlagandFireworks
  1271.  
  1272. mpass& = mpass& + 1
  1273. IF TIMER <= start1! THEN start1! = TIMER: mpass& = 1
  1274. speed = ((TIMER - start1!) / mpass&) * h * t
  1275.  
  1276. IF rick THEN GraphSpeed
  1277.  
  1278. IF magic = 1 THEN '                                                   magic landing, 1st step laser the surface to level
  1279.     sf = 0
  1280.     z = suri + px!
  1281.     IF z > q1 THEN z = z - q1
  1282.     sf(0, 0) = z - 35 '                                               cut out a swath 70 units wide
  1283.     sf(0, 1) = z + 35
  1284.     GOSUB lsurface '                                                  apply laser
  1285.     a = 0 '                                                           angle
  1286.     auto = 0 '                                                        autopilot
  1287.     vx! = 0 '                                                         cancel any x velocity
  1288.     vy! = 0 '                                                         cancel any y velocity
  1289.     py! = 331 + ASO * 9 '                                             ground has been cut to the lowest
  1290.     cut = 1 '                                                         signal engine off
  1291.     magic = 2
  1292.  
  1293. '                                                                     kill surface feature
  1294. IF firel AND ksf AND (contact = 0) AND (sf(sf, 2) > 0) THEN
  1295.     GOSUB lsurface
  1296. firel = ks '                                                          ks = keep shooting
  1297.  
  1298. '                                                                     terrain following
  1299. IF tfollow AND (contact = 0) AND (dump = 0) AND (liftoff = 0) THEN
  1300.     hover = 1
  1301.     hp = q1
  1302.     svx = SGN(vx!)
  1303.     IF svx < 0 THEN tx = sx1 ELSE tx = sx2
  1304.     la = ABS(vx!) * t
  1305.     IF la < t THEN la = t
  1306.     IF la > h THEN la = h
  1307.     FOR i = -(wi + 5) TO la
  1308.         j = tx + i * svx
  1309.         k = j
  1310.         IF k < 0 THEN k = k + q1
  1311.         IF k > q1 THEN k = k - q1
  1312.         z = gety(k)
  1313.         IF z < hp THEN hp = z: sx = j
  1314.     NEXT i
  1315.     cx = ABS(sx - tx)
  1316.     IF cx THEN
  1317.         cy = hp - t - ABS(a / 2) - sy1
  1318.         st! = cy / cx * (ABS(vx!) + 1)
  1319.         IF st! > 2 THEN st! = 2
  1320.         IF st! < -t THEN st = -t
  1321.         fst = -SGN(st!) * 2
  1322.         py! = py! + st!
  1323.         IF py! < 250 THEN py! = 250
  1324.     END IF
  1325. IF paraf THEN
  1326.     IF py! > 150 THEN mes$(0) = "Parachutes don't work in a vacuum!"
  1327.     Parachute
  1328.  
  1329.  
  1330. TextOnLM:
  1331. IF (ASO = 0) AND (ABS(ta) < t) THEN
  1332.     lt = LEN(TextOnLM$)
  1333.     tx = px! - lt * 2 + rfx
  1334.     ty = py! + rfy
  1335.     IF ty > 340 THEN ty = 340
  1336.     TinyFont TextOnLM$, tx, ty, white
  1337. TextOnLM$ = ""
  1338.  
  1339. KillThreats:
  1340. killed = 0
  1341. FOR i = 0 TO 20 '                                                     shells
  1342.     c1 = shield AND (shx(i) > 0) AND (shd(i) < 70) '                  shield on and shell close to LM
  1343.     c2 = firel AND (shx(i) > 0) '                                     fire laser and shell in air
  1344.     IF c1 OR c2 THEN
  1345.         killed = 1 '                                                  found something to kill
  1346.         tx = shx(i) - suri
  1347.         ty = shy(i)
  1348.         GOSUB LMfl '                                                  fl = fire laser
  1349.         IF LEN(dead$) THEN RETURN
  1350.         ExplodeShell i
  1351.     END IF
  1352.  
  1353. ks = 0
  1354. FOR i = 1 TO 6
  1355.     IF skyoff OR (ek(i) = -1) THEN GOTO ni3
  1356.     '                   CM DS BO BH WO Co
  1357.     IF firel AND (exl(i) > gs) AND (exl(i) < q3) THEN
  1358.         killed = 1
  1359.         ks = 1
  1360.         tx = exl(i)
  1361.         ty = ey(i)
  1362.         IF laserb = 0 THEN laserb = 5
  1363.         IF laserb > 0 THEN
  1364.             GOSUB LMfl
  1365.             IF LEN(dead$) THEN RETURN
  1366.             k = (5 - laserb) * 4
  1367.             IF i > 1 THEN
  1368.                 CIRCLE (tx, ty), k, yellow
  1369.                 PAINT (tx, ty), yellow, yellow
  1370.             END IF
  1371.             laserb = laserb - 1
  1372.         END IF
  1373.         IF laserb = 0 THEN
  1374.             ks = 0
  1375.             IF i = 1 THEN
  1376.                 mes$(1) = "The Dark Side has cookies!"
  1377.             ELSE
  1378.                 FOR a2 = 0 TO tsix STEP 2
  1379.                     x2 = tx + RND * h * c!(a2) * aspect!
  1380.                     y2 = ty + RND * h * s!(a2)
  1381.                     LINE (tx, ty)-(x2, y2), gold
  1382.                 NEXT a2
  1383.                 ek(i) = -1
  1384.                 exv(i) = 0
  1385.                 exl(i) = -1
  1386.                 IF (i = 2) AND lob THEN dead$ = "SELF-DESTRUCT"
  1387.             END IF
  1388.         END IF
  1389.     END IF
  1390.     ni3:
  1391. IF killed THEN ksf = 0 ELSE ksf = 1
  1392.  
  1393. lsurface: '                                                           laser surface feature
  1394. z = (RND > .9) OR (magic = 1) '                                       1 out of 10 destroys, magic always
  1395. FOR i = sf(sf, 0) TO sf(sf, 1)
  1396.     tx = i - suri
  1397.     IF tx < 0 THEN tx = tx + q1
  1398.     ty = gety(tx)
  1399.     IF sf <> 3 THEN ty = ty + RND * (q4 - ty)
  1400.     IF i MOD 2 THEN GOSUB LMfl '                                      fire laser
  1401.     IF z THEN gh(i) = glmax '                                         level
  1402.     Smooth sf(sf, 0) - 1 '                                            smooth transition from where the ground has been leveled, left side
  1403.     Smooth sf(sf, 1) '                                                                                                        , right side
  1404.     sf(sf, 2) = -1
  1405.  
  1406. LMfl: '                                                               fire laser
  1407. IF (cwd < 50) AND (sy1 > szs) THEN '                                  in car wash?
  1408.     dead$ = "REFLECTED LASER"
  1409.     cwd = 999
  1410.     firel = 0
  1411.     laserb = 0
  1412.     ks = 0
  1413.     RETURN
  1414. FOR zx = -1 TO 1
  1415.     FOR zy = -1 TO 1
  1416.         LINE (sx0 + zx, sy0 + zy)-(tx, ty), lmsl
  1417.     NEXT zy
  1418. NEXT zx
  1419. geof = t
  1420.  
  1421. flevel: '                                                             make fuel level when angle > 4
  1422. IF ASO THEN RETURN '                                                  no fuel shown with AS
  1423. ptk = (h - fuel!) * 2.7 '                                             pixels to kill
  1424. z = ptk '                                                             ptk used by ExplodeLM
  1425. x1 = px! - 16
  1426. x2 = px! + 14
  1427. y1 = py! - 15
  1428. y2 = py! + 15
  1429. FOR y = y1 TO y2
  1430.     FOR x = x1 TO x2
  1431.         IF POINT(x, y) = fuel THEN
  1432.             PSET (x, y), black2
  1433.             z = z - 1
  1434.         END IF
  1435.     NEXT x
  1436.     IF z <= 0 THEN EXIT FOR
  1437.  
  1438. deflect: '                                                            flame bounce
  1439. oz = gety(-x)
  1440. IF deflectat > 0 THEN oz = deflectat
  1441. z = oz
  1442.  
  1443. '       dump           side t      st in pause
  1444. IF (c = fuel) OR (c = -yellow) OR (c = -blue) THEN
  1445.     IF (fx1 > 0) AND (x < fx1) THEN z = 0
  1446.     IF (fx2 > 0) AND (x > fx2) THEN z = 0
  1447.     rf1 = RND * t + 1
  1448.     rf2 = RND * 20 - t
  1449.     IF y >= (z - 1) THEN '                                            yep, deflect it
  1450.         IF x < sx1 THEN
  1451.             IF fx1 = 0 THEN fx1 = x: fy1 = LMry(th1)
  1452.             x = fx1 + rf1
  1453.             y = fy1 + rf2
  1454.         ELSE
  1455.             IF fx2 = 0 THEN fx2 = x: fy2 = LMry(th2)
  1456.             x = fx2 - rf1
  1457.             y = fy2 + rf2
  1458.         END IF
  1459.     END IF
  1460.     RETURN
  1461.  
  1462. IF y >= (z - 1) THEN '                                                yep, deflect it
  1463.     IF sy1 < borgt THEN ky1 = 1: GOTO isborg
  1464.     IF eflag = 0 THEN '                                               limit flame climbing
  1465.         eflag = 1 '                                                   only once per position
  1466.         xmin2 = phg - thrust! * 1.5 '                                 point hit ground
  1467.         xmax2 = phg + thrust! * 1.5
  1468.         u1 = 0 '                                                      up count l of nozzle
  1469.         u2 = 0 '                                                      up count r of nozzle
  1470.         wu1 = 0 '                                                     worst l up count
  1471.         wu2 = 0 '                                                     worst r up count
  1472.         ky1 = 0 '                                                     keep y
  1473.         ky2 = 0 '                                                     keep y
  1474.         FOR zz = phg TO phg - h STEP -1 '                             from LM center left
  1475.             z2 = gety(-zz): IF zz = phg THEN lz = z2
  1476.             k1 = z2 - lz
  1477.             lz = z2
  1478.             IF k1 > 0 THEN '                                          down
  1479.                 u1 = 0
  1480.             ELSE
  1481.                 u1 = u1 - k1 '                                        up
  1482.                 IF u1 > wu1 THEN wu1 = u1 '                           worst up
  1483.             END IF
  1484.             IF u1 > 20 THEN xmin2 = zz + 2: EXIT FOR
  1485.             IF ABS(k1) > 20 THEN ky1 = 1 '                            90 degrees TMA etc
  1486.         NEXT zz
  1487.         FOR zz = phg TO phg + h '                                     from LM center right
  1488.             z2 = gety(-zz): IF zz = phg THEN lz = z2
  1489.             k2 = z2 - lz
  1490.             lz = z2
  1491.             IF k2 > 0 THEN '                                          down
  1492.                 u2 = 0
  1493.             ELSE
  1494.                 u2 = u2 - k2 '                                        up
  1495.                 IF u2 > wu2 THEN wu2 = u2 '                           worst up
  1496.             END IF
  1497.             IF u2 > 20 THEN xmax2 = zz - 2: EXIT FOR
  1498.             IF ABS(k2) > 20 THEN ky2 = 1 '                            90 degrees TMA etc
  1499.         NEXT zz
  1500.     END IF
  1501.  
  1502.     isborg:
  1503.     r = thrust! * 2 + (RND - pf!) * 80
  1504.     x = (phg - r) + RND * (r * 2)
  1505.     k = ABS(x - phg + a * 2) / 4
  1506.  
  1507.     tx = x + suri '                                                   McDonalds
  1508.     IF (tx >= sf(5, 0)) AND (tx <= sf(5, 1)) AND (py! > 250) THEN
  1509.         ky1 = 0: ky2 = 0
  1510.     END IF
  1511.  
  1512.     IF (ky1 = 1) OR (ky2 = 1) THEN '                                  keep
  1513.         y = z - RND * k - 1: RETURN
  1514.     END IF
  1515.  
  1516.     x2 = (RND - pf!) * 20
  1517.     IF x < xmin2 THEN x = xmin2 + RND * (xmax2 - xmin2) + x2
  1518.     IF x > xmax2 THEN x = xmin2 + RND * (xmax2 - xmin2) - x2
  1519.  
  1520.     IF (platform > 0) AND (ABS(px! - (pminx + 17)) < 20) THEN
  1521.         y = y - platform
  1522.     ELSE
  1523.         y = gety(-x) - RND * k - 1
  1524.     END IF
  1525.  
  1526.     IF (deflectat > 0) AND (y > deflectat) THEN y = deflectat - (y - deflectat)
  1527.  
  1528. CWceiling: '                                                          car wash
  1529. cwd = ABS((suri + px!) - sf(2, 2)) '                                  car wash distance
  1530. IF ASO THEN szs = 323 ELSE szs = 340 '                                safe zone start
  1531. IF (cwd < 69) AND (sy1 > 304) THEN '                                  lower than top of building
  1532.     IF sy1 >= q4 THEN '                                               touched down inside
  1533.         cc1 = -1
  1534.     ELSEIF sy2 >= q4 THEN '                                           touched down inside
  1535.         cc2 = -1
  1536.     ELSEIF sy1 > szs THEN '                                           in safe zone
  1537.         cc1 = 0
  1538.         cc2 = 0
  1539.         IF cwd < 50 THEN mes$(0) = "Washee washee no starchee!"
  1540.     ELSE
  1541.         IF (sy1 > (szs - t)) AND (sy1 <= szs) THEN '                  bouncing off ceiling
  1542.             cc1 = 0
  1543.             cc2 = 0
  1544.             vy! = 1
  1545.             py! = py! + 2
  1546.             'hover = 1
  1547.         END IF
  1548.     END IF
  1549.  
  1550. CheckHit: '                                                           contact with ground
  1551. cc1 = ((sy1 + 1) >= gety(-sx1)) '                                     left pad
  1552. cc2 = ((sy2 + 1) >= gety(-sx2)) '                                     right pad
  1553. mingx = 0
  1554. mingy = q1
  1555. FOR zx = sx1 TO sx2 '                                                 check between pads
  1556.     zy = sy1 - 2
  1557.     p = POINT(zx, zy)
  1558.     IF p = gray THEN '                                                got 1
  1559.         ty = gety(-zx)
  1560.         IF ty < mingy THEN mingx = zx: mingy = ty
  1561.     END IF
  1562. NEXT zx
  1563. IF mingx THEN
  1564.     i = mingx - sx1
  1565.     j = sx2 - mingx
  1566.     IF i < j THEN cc1 = -1 ELSE cc2 = -1
  1567.  
  1568. GOSUB CWceiling '                                                     car wash
  1569. IF vy! < 0 THEN RETURN '                                              going UP
  1570.  
  1571. IF cc1 OR cc2 THEN '                                                  pad(s) on ground
  1572.     contact = 1
  1573.     tmt! = 0
  1574.     py! = py! + rfy '                                                 no time to correct jitter
  1575.     TexOnLM$ = ""
  1576.     warp! = 0
  1577.     GOSUB CutOrOutOfFuel
  1578.  
  1579.     IF (vy! > 0) AND ABS(sy1 - (ey(2) - 40)) < t THEN
  1580.         lob = 1 '                                                     landed on Borg
  1581.         vx! = vx! - exv(2)
  1582.     END IF
  1583.  
  1584.     IF (ABS(vx!) > t) OR (vy! > 20) THEN
  1585.         dead$ = "HIGH SPEED IMPACT!"
  1586.         RETURN
  1587.     END IF
  1588.  
  1589.     dp = 8 + (h - fuel!) \ 25 '                                       8 - 12
  1590.     IF (vy! > dp) OR (ABS(vx!) > 8) THEN '                            too fast given load
  1591.         crash = 1
  1592.         panelinit = 0
  1593.         shield = 0
  1594.         dead$ = "CRASHED"
  1595.         z = ABS(vx!) * t + ABS(vy!) * t
  1596.         FOR i = 1 TO rp '                                             create layer of debris
  1597.             LMrx(i) = LMrx(i) + RND * z - (z \ 2)
  1598.             LMry(i) = gety(LMrx(i)) - RND * 2 - 1
  1599.         NEXT i
  1600.         IF bw = 0 THEN
  1601.             PALETTE green, 0 '                                            blank instruments
  1602.             PALETTE yellow, 0
  1603.         END IF
  1604.         RETURN
  1605.     END IF
  1606.  
  1607.     IF (vy! > 3) OR (ABS(vx!) > 3) THEN fb$ = "vehicle damaged"
  1608.  
  1609.     IF (vy! > 4) OR (ABS(vx!) > 4) THEN
  1610.         fb$ = "vehicle severely damaged"
  1611.         LMdistort '                                                   randomly vary structure
  1612.         vsd = 1 '                                                     vehicle severely damaged
  1613.     END IF
  1614.  
  1615.     savea = a + ma
  1616.  
  1617.     IF lob THEN '                                                     landed on Borg
  1618.         a = 0
  1619.         IF sx1 < borgl THEN a = 45
  1620.         IF sx2 > borgr THEN a = -45
  1621.         py! = py! - t * (ABS(a) = 45)
  1622.         RETURN
  1623.     END IF
  1624.  
  1625.     '                                                                 optional, allow ANY part of pad
  1626.     IF cc1 THEN cd = -1: cpx = sx2: cpy = sy2 + 1
  1627.     IF cc2 THEN cd = 1: cpx = sx1: cpy = sy1 + 1
  1628.     FOR i = 1 TO 4
  1629.         cpx = cpx + cd
  1630.         IF (cpy >= gety(-cpx)) THEN
  1631.             IF cc1 THEN cc2 = 1 ELSE cc1 = 1
  1632.         END IF
  1633.     NEXT i
  1634.  
  1635.     IF NOT (cc1 AND cc2) THEN '                                       only 1 pad down
  1636.         npass = 0
  1637.         DO: _LIMIT mdelay * 2 '                                       settle LM
  1638.             a = a + (cc1 - cc2)
  1639.             pa:
  1640.             npass = npass + 1
  1641.             IF npass > 150 THEN EXIT DO
  1642.             GOSUB Plotscreen '                                        show change
  1643.             IF LEN(dead$) THEN EXIT DO
  1644.             IF ABS(a) > 40 THEN
  1645.                 a = 180 '                                             upside down
  1646.                 py! = glmax - ny
  1647.                 LMdistort '                                           optional
  1648.                 EXIT DO
  1649.             END IF
  1650.             IF cc1 AND (sy1 < gety(-sx1)) THEN py! = py! + 1: GOTO pa
  1651.             IF cc2 AND (sy2 < gety(-sx2)) THEN py! = py! + 1: GOTO pa
  1652.             cc3 = ((sy1 + 1) >= gety(-sx1))
  1653.             cc4 = ((sy2 + 1) >= gety(-sx2))
  1654.             IF ABS(a) > 80 THEN py! = glmax - wi2
  1655.  
  1656.             z = gety(INT(px!)) - py! - ny + 5
  1657.             IF (z < 0) AND (paraf = 0) THEN
  1658.                 dead$ = "PUNCTURE DAMAGE"
  1659.                 RETURN
  1660.             END IF
  1661.         LOOP UNTIL (cc1 AND cc4) OR (cc2 AND cc3)
  1662.     END IF
  1663.  
  1664. slimit: '                                                             surface index bounds
  1665. z = 0
  1666. IF suri < 0 THEN z = q1
  1667. IF suri >= q1 THEN z = -q1
  1668. suri = suri + z
  1669. IF lock1 THEN lock1 = lock1 + z
  1670.  
  1671. radar: '                                                              autopilot landing here too
  1672. IF contact OR liftoff THEN RETURN
  1673. z = SGN(vx!): IF z = 0 THEN z = 1
  1674. IF z = -1 THEN sbl = -280 ELSE sbl = 220
  1675. bt = (bt MOD 4) + 1
  1676. div = ABS(alt!) \ 2 + bt
  1677.  
  1678. IF right OR left THEN tvx! = sv! ELSE tvx! = vx!
  1679. IF ABS(tvx!) > 99 THEN tvx! = 99 * SGN(tvx!)
  1680. IF (tfollow = 0) AND (aboveborg OR ((radarf = 0) AND (auto = 0))) THEN tvx! = 0
  1681. bl = sbl * ABS(tvx!) + (sx1 - sx2)
  1682. IF ABS(bl) > ABS(sbl) THEN bl = sbl
  1683. IF auto = 0 THEN lock1 = 0
  1684. IF lock1 = 0 THEN rxm = sx2 + bl ELSE rxm = lock1 - suri
  1685.  
  1686. level = 1
  1687. FOR j = 0 TO wi '                                                     width (distance between pads)
  1688.     tx = rxm + j
  1689.     ty = gety(-tx)
  1690.     IF aboveborg AND (sx1 >= borgl) AND (sx2 <= borgr) THEN ty = borgt
  1691.     IF j = 0 THEN cmp = ty
  1692.     IF ABS(cmp - ty) > 1 THEN level = 0
  1693.  
  1694. IF level THEN
  1695.     IF auto AND (lock1 = 0) THEN '                                    automatic yet no current lock
  1696.         lock1 = suri + rxm - SGN(rxm) * 2 * (vx! <> 0) '              lock onto level ground
  1697.     END IF
  1698.     rbeam = green '                                                   radar beam color
  1699.     lock1 = 0 '                                                       not level, cancel lock
  1700.     rbeam = red '                                                     radar beam color
  1701.  
  1702. rpass = rpass XOR 1
  1703. IF level AND (vx! = 0) THEN
  1704.     div = div \ 2
  1705.     IF div < 1 THEN div = 1
  1706.     IF rpass THEN rbeam = 0
  1707.  
  1708. FOR i = 0 TO (wi + 1) STEP 5
  1709.     IF vx! > 0 THEN tx = rxm + i ELSE tx = rxm + wi - i
  1710.     IF aboveborg THEN
  1711.         tx = sx1 + i
  1712.         ty = borgt
  1713.     ELSE
  1714.         ty = gety(tx)
  1715.     END IF
  1716.     IF (warp! < 1) AND (ty > sy0) AND (radarf > 0) THEN GOSUB rbeam
  1717.  
  1718. IF auto = 0 THEN GOTO end6
  1719. IF aboveborg OR (abort = 0) THEN GOTO skipit
  1720.  
  1721. abort:
  1722. hover = 1
  1723. hoverc = 0
  1724. lock1 = 0
  1725.  
  1726. i = (py! > 120) '                                                     too low
  1727. j = NOT ((vx! = 0) AND (level = 1)) AND (ABS(vx!) < (ideal! - .05)) ' too slow
  1728. k = (ABS(vx!) > (ideal! + .05)) '                                     too fast
  1729. IF i THEN wa = -ma: hoverc = -3
  1730. IF j THEN wa = 4 * -z + ma
  1731.     wa = ABS(vx!) * z - ma
  1732.     IF ABS(wa) > 20 THEN wa = 20 * z
  1733. IF i OR j OR k THEN abort = 1: GOTO end6
  1734. abort = 0
  1735.  
  1736. skipit:
  1737. IF lam THEN '                                                         land at McDonalds
  1738.     dis = ABS((suri + rxm) - sf(5, 2))
  1739.     IF dis > 80 THEN level = 0: lock1 = 0
  1740. wa = -ma ' want angle = -malfunction angle
  1741.  
  1742. IF dflag THEN dump = 0: dflag = 0
  1743. IF level = 0 THEN '                                                   locked onto a target
  1744.     abort = 1
  1745.     ddd = ABS(px! - rxm)
  1746.     IF (ddd < 120) AND (lock1 > 0) AND (auto = 1) AND (fuel! > 70) THEN
  1747.         dump = 1
  1748.         dflag = 1
  1749.     END IF
  1750.     IF ddd < h THEN '                                                 100 clicks away
  1751.         hover = 0 '                                                   stop hovering
  1752.         vert = 1 '                                                    start moving down
  1753.         dist = sx1 - rxm '                                            distance to target
  1754.         thv! = ABS(dist) / 27 '                                       to horizontal velocity
  1755.         IF thv! < .08 THEN mu = 1 ELSE mu = 4
  1756.         IF thv! < .01 THEN mu = 0
  1757.         IF aboveborg = 0 THEN
  1758.             IF ABS(vx!) > thv! THEN wa = wa + mu * z
  1759.         END IF
  1760.     END IF
  1761. end6:
  1762. GOSUB angle
  1763.  
  1764. rbeam:
  1765. dx! = (tx - sx0) / div
  1766. dy! = (ty - sy0) / div
  1767. FOR j = 1 TO q1
  1768.     tx = sx0 + j * dx!
  1769.     ty = sy0 + j * dy!
  1770.     my = gety(-tx)
  1771.     IF ty >= my THEN
  1772.         IF (tx < rxm) OR (tx > (rxm + wi + 1)) THEN level = 0: rbeam = red
  1773.         EXIT FOR
  1774.     END IF
  1775.     IF i AND (rbeam > 0) THEN
  1776.         PSET (tx, ty), rbeam
  1777.         IF radarf = 2 THEN PSET (tx + 1, ty), rbeam
  1778.     END IF
  1779.  
  1780. angle:
  1781. cf = 0
  1782. IF a <> wa THEN '                                                     current angle, wanted angle
  1783.     w = a '                                                           was = angle
  1784.     a = a + SGN(wa - a)
  1785.     change = a - w
  1786.     IF change THEN
  1787.         cf = 1
  1788.         a1 = ABS(w + ma)
  1789.         a2 = ABS(a + ma)
  1790.         IF (a1 > 4) OR (a2 > 4) THEN wan = 3 '                        activate up/down
  1791.     END IF
  1792.      
  1793. IF liftoff OR ((auto = 0) AND (vert = 1) AND (ma = 0)) THEN RETURN
  1794. cp = (a <> 0) AND (RND < .01) '                                       clear problem
  1795.  
  1796. IF cf OR cp THEN
  1797.     IF cp OR (RND < .01) THEN
  1798.         z = ma
  1799.         IF cp THEN ma = 0 ELSE ma = a
  1800.         IF ma <> z THEN '                                             new malfunction angle
  1801.             IF ma THEN
  1802.                 z$ = LTRIM$(STR$(-ma))
  1803.                 IF ma < 0 THEN z$ = "+" + z$
  1804.                 mes$(0) = "DANGER! STUCK THRUSTER " + z$
  1805.                 IF auto THEN a = a - ma: wa = a - ma '                immediate correct
  1806.             ELSE
  1807.                 mes$(0) = "THRUSTERS OK"
  1808.                 IF auto THEN a = a + z: wa = a + z '                  immediate correct
  1809.             END IF
  1810.         END IF
  1811.     END IF
  1812.  
  1813. Exhaust:
  1814. IF inpause THEN tflame = blue ELSE tflame = flame
  1815.  
  1816. IF cut THEN thrust! = 0
  1817. d = thrust! - (RND * 20 - t) * (thrust! > 0)
  1818. x = (LMx(lp) + LMx(rp)) \ 2 '                                         halfway between pads
  1819.  
  1820. IF ASO THEN '                                                         ascent stage only
  1821.     i = 30 '                                                          divisor for exhaust width
  1822.     j = 1 '                                                           throwing x off up to this amount
  1823.     k = 3 '                                                           flame decrement
  1824.     y = ny + 1 '                                                      starting y
  1825.     i = 20 '                                                          divisor for exhaust width
  1826.     j = 2 '                                                           throwing x off up to this amount
  1827.     k = 2 '                                                           flame decrement
  1828.     y = ny - 3 '                                                      starting y
  1829.  
  1830. WHILE d > 0 '                                                         until thrust decremented to 0
  1831.     p = d \ i
  1832.     FOR z = -1 TO 1 STEP 2
  1833.         FOR jj = 0 TO 3
  1834.             n = n + 1 '                                               add to vehicle daa
  1835.             IF n > 1400 THEN END '                                    beyond array size
  1836.             LMx(n) = x + p * z + RND * (j * 2) - j
  1837.             LMy(n) = y + RND * 2
  1838.             IF (powerloss > 0) AND (RND < .3) THEN zz = orange ELSE zz = tflame
  1839.             LMc(n) = zz '                                             yellow normally, blue during pause
  1840.             IF RND > .95 THEN '                                        some way off plume for realism
  1841.                 LMx(n) = LMx(n) - RND * 80 + 40
  1842.                 LMy(n) = LMy(n) + 5
  1843.             END IF
  1844.         NEXT jj
  1845.     NEXT z
  1846.     y = y + 1 '                                                       next flame row
  1847.     d = d - k '                                                       decrement temp thrust
  1848. n3 = n '                                                              main/side thrusters
  1849.  
  1850. '                                                                     if there's a thruster malfunction, may have both thrusters active
  1851. IF (ma = 0) OR (a = 0) OR (SGN(a) = SGN(ma)) THEN
  1852.     ta = a + ma
  1853.     pass = 1
  1854.     ta = a
  1855.     pass = 2
  1856. IF dump THEN ta = t
  1857.  
  1858. dors: '                                                               dump fuel or sideways motion
  1859. IF liftoff THEN ta = 0
  1860. IF rfx AND (dump = 0) THEN ta = rfs! * 50
  1861. IF (contact = 1) AND (dump = 0) THEN ta = 0: wan = 0: super = 0
  1862. IF ta <> 0 THEN
  1863.     IF ta < 0 THEN th0 = th1: z! = -2
  1864.     IF ta > 0 THEN th0 = th2: z! = 2
  1865.     zz = ta: IF zz > t THEN ta = t
  1866.     tt = ABS(zz * 4 + 4 * SGN(ta))
  1867.     IF ABS(zz) > 20 THEN tt = t
  1868.     DO
  1869.         n = n + 1
  1870.         LMx(n) = LMx(th0) + z! + RND * 2 - 1
  1871.         LMy(n) = LMy(th0) + (RND * 2 - 1) * (ABS(ta) > 2)
  1872.         IF dump THEN
  1873.             tc = fuel
  1874.             z = 20 - 20 * s!(90 + (LMx(n) - LMx(th0)) * 1.8)
  1875.             IF a = 180 THEN z = -z
  1876.             LMy(n) = LMy(n) + z
  1877.         ELSE
  1878.             tc = -tflame
  1879.         END IF
  1880.         LMc(n) = tc
  1881.         tt = tt - 1
  1882.         z! = z! * 1.15
  1883.     LOOP UNTIL (tt = 0) OR (ABS(z!) > 40)
  1884.     IF dump THEN
  1885.         ta = -ta
  1886.         IF lockfuel = 0 THEN fuel! = fuel! - .1 + (fuel! > 5) * 2
  1887.         IF ta = -t THEN GOTO dors
  1888.         IF fuel! < 1 THEN dump = 0
  1889.     END IF
  1890. pass = pass - 1
  1891. IF pass THEN ta = ma: GOTO dors
  1892. noside:
  1893.  
  1894. '                                                                     super - use side thrusters to augment main thrust when more than
  1895. '                                                                     100% thrust is called for
  1896. IF fst OR super OR (wan > 0) THEN '                                   up/down to change angle beyond 5 degrees
  1897.     IF change > 0 THEN th1d = -1: th2d = 1
  1898.     IF change < 0 THEN th2d = -1: th1d = 1
  1899.     IF super THEN th1d = 1: th2d = 1
  1900.     IF fst THEN th1d = fst: th2d = fst: fst = 0
  1901.     FOR z = 0 TO 6
  1902.         n = n + 1
  1903.         LMx(n) = LMx(th1) + RND * 2
  1904.         LMy(n) = LMy(th1) + th1d * (z + RND * 2) + 2
  1905.         LMc(n) = tflame '                                             blue flame in pause
  1906.         n = n + 1 '                                                   other thruster opposite
  1907.         LMx(n) = LMx(th2) + RND * 2 - 2
  1908.         LMy(n) = LMy(th2) + th2d * (z + RND * 2) + 2
  1909.         LMc(n) = tflame
  1910.     NEXT z
  1911.     wan = wan - 1
  1912.     IF wan = 1 THEN change = -change
  1913.  
  1914.  
  1915. init1: '                                                              only done once
  1916. DATA convo,f1,f2,lmx1,lmy1,lmc1,lmx2,lmy2,lmc2
  1917. DATA h1,h2,h3,h4,h5,h6,cybill,surv2,cm,rad,af2,sf2,panel
  1918. DATA sd,sl,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,panel0,panel1
  1919. DATA dstarm,stars,lanblank,alien
  1920.  
  1921. RESTORE init1
  1922. IF _FILEEXISTS("rick.") THEN okrick = 1
  1923. tc$ = UCASE$(COMMAND$ + "   ")
  1924. IF LEFT$(tc$, 1) = "/" THEN tc$ = "   "
  1925. IF INSTR(tc$, "DOS") THEN dosbox = 0 '                                use large star file
  1926. IF INSTR(tc$, "BOX") THEN dosbox = 1 '                                use small star file
  1927. IF INSTR(tc$, "CD ") THEN iscd = 1 '                                  simulate CD
  1928. IF INSTR(tc$, "UFO ") THEN ufof = 1 '
  1929. IF _FILEEXISTS("cd.dat") THEN iscd = 1 '                              include/create this file for CD/DVD distribution (read only)
  1930.  
  1931. z = 0
  1932. FOR i = 1 TO 40
  1933.     READ f$(i)
  1934.     IF i = 38 THEN '                                                  stars
  1935.         j = 2 - dosbox '                                              1=small, 2=medium, 3=huge
  1936.         f$(i) = f$(i) + CHR$(48 + j)
  1937.     END IF
  1938.     IF i THEN
  1939.         f$(i) = f$(i) + ".dat" '                                      try lowercase first
  1940.         IF _FILEEXISTS(f$(i)) = 0 THEN
  1941.             f$(i) = UCASE$(f$(i)) '                                   try uppercase (Linux cares!)
  1942.             IF _FILEEXISTS(f$(i)) = 0 THEN
  1943.                 z = z + 1
  1944.                 IF z = 1 THEN CLS
  1945.                 PRINT f$(i)
  1946.             END IF
  1947.         END IF
  1948.     END IF
  1949.     PRINT
  1950.     PRINT "Above file(s) missing"
  1951.     SLEEP
  1952.     SYSTEM
  1953.  
  1954. s& = VARSEG(p(0, 0))
  1955. o& = VARPTR(p(0, 0))
  1956. DEF SEG = s&
  1957. BLOAD "F1.dat", o&
  1958. z$ = "386C6C38" '                                                    degree symbol
  1959. FOR i = 0 TO 3
  1960.     p(0, i) = VAL("&H" + MID$(z$, i * 2 + 1, 2))
  1961.  
  1962. s& = VARSEG(p2(0, 0))
  1963. o& = VARPTR(p2(0, 0))
  1964. DEF SEG = s&
  1965. BLOAD "F2.dat", o&
  1966.  
  1967. canvas& = _NEWIMAGE(640, 350, 9)
  1968. SCREEN canvas&
  1969. _TITLE "Lander"
  1970. auto = 0 '                                                            full automatic
  1971. background = 1 '                                                      textured LED displays
  1972. cbh = 0 '                                                             constant black holes
  1973. darkstars = 1 '                                                       spin
  1974. darkstart = 1 '                                                       thickness of lines
  1975. demo = 0 '                                                            cram onto one page
  1976. doclock = 0 '                                                         shield effect
  1977. gh = 9
  1978. gs = 85 '                                                             graphics start
  1979. glmax = q4 '                                                          ground level max
  1980. glmin = glmax - 49 '                                                  ground level min
  1981. gs = 85 '                                                             graphics start (flying area)
  1982. 'gstyle = 5
  1983. invincible = 1 '                                                      easier for beginner, thrusters gold
  1984. jitter = 1 '                                                          thrust calc
  1985. LED$ = "021404120115" '                                               color sequence - gr ye re or gun wh
  1986. LEDc = green '
  1987. LEDtri = 0 '                                                          off
  1988. mdelay = t '                                                          master delay
  1989. opower = 62 '                                                         original thrust factor
  1990. pdiv = 0 '                                                            instrument update
  1991. radarf = 1
  1992. restart = 0 '                                                         shift-d load defaults
  1993. segs$ = "abcdefg" '                                                   for 7 segment displays
  1994. settings$ = "LANDER.SET"
  1995. shield = 0 '                                                          Star Trek!
  1996. showmap = 0 '                                                         silly legend at top
  1997. skyoff = 1 '                                                          DS, BH, Wo, Co
  1998. starfiles = 1 '                                                       dat1, dat2, dat3
  1999. starstatus = 1 '                                                      show stars only, no names/info
  2000. twinkle = 0
  2001. zoom = 1 '                                                            starfield 6 hours 45 degrees
  2002.  
  2003. black = 0: blue = 1: green = 2: gunmetal = 3: red = 4: gasoline = 5
  2004. gray2 = 6: white = 7: gray = 8: dred = 9: gold = 10: black2 = 11
  2005. orange = 12: blue2 = 13: yellow = 14: white2 = 15
  2006.  
  2007. craft = white: flame = yellow: fuel = gasoline: LEDc = green
  2008. LMci(0) = gray2 '                                                     ASO shifting colors
  2009. LMci(1) = gold
  2010. LMci(2) = gray2
  2011. LMci(3) = black2
  2012.  
  2013. IF _FILEEXISTS(settings$) THEN
  2014.     OPEN settings$ FOR INPUT AS #1
  2015.     nflags = 0
  2016.     DO
  2017.         IF EOF(1) THEN EXIT DO
  2018.         INPUT #1, g$
  2019.         IF EOF(1) THEN EXIT DO
  2020.         nflags = nflags + 1
  2021.         INPUT #1, tflags(nflags)
  2022.     LOOP
  2023.     CLOSE #1
  2024.  
  2025. auto = tflags(1)
  2026. background = tflags(2)
  2027. cbh = tflags(3)
  2028. demo = tflags(4)
  2029. doclock = tflags(5)
  2030. invincible = tflags(6)
  2031. jitter = tflags(7)
  2032. LEDc = tflags(8)
  2033. LEDtri = tflags(9)
  2034. radarf = tflags(10)
  2035. shield = tflags(11)
  2036. showmap = tflags(12)
  2037. starstatus = tflags(13)
  2038. zoom = tflags(14)
  2039. skyoff = tflags(15)
  2040. gstyle = tflags(16)
  2041. mouseswap = tflags(17)
  2042. porb = tflags(18)
  2043. starfiles = tflags(19)
  2044. mdelay = tflags(20)
  2045. fsf = tflags(21)
  2046.  
  2047. IF fsf THEN
  2048.  
  2049. FOR i = 0 TO tsix '                                                    table faster
  2050.     s!(i) = SIN(_D2R(i))
  2051.     c!(i) = COS(_D2R(i))
  2052.  
  2053. clines = 0
  2054. OPEN f$(1) FOR INPUT AS #1 '                                          convo.dat, LM/CM chatter
  2055.     clines = clines + 1
  2056.     LINE INPUT #1, convo$(clines)
  2057.  
  2058. s& = VARSEG(cmp&(0)) '                                                Command Module
  2059. o& = VARPTR(cmp&(0))
  2060. DEF SEG = s& '                                                        cm.dat
  2061. BLOAD f$(18), o&
  2062.  
  2063. IF (RND > .95) AND (okrick = 0) AND (INSTR(COMMAND$, "NOS") = 0) THEN MakeSur
  2064.  
  2065. start1! = TIMER
  2066.  
  2067. init2: '                                                              each cycle
  2068. a = 0 '                                                               angle
  2069. a51i = 0
  2070. ASO = 0 '                                                             ascent stage only = false
  2071. boltc = 0 '                                                           lightning count
  2072. center = 362
  2073. contact = 0 '                                                         with ground
  2074. convo = 0 '                                                           with CM
  2075. crash = 0
  2076. cut = 0 '                                                             engine
  2077. dump = 0 '                                                            fuel
  2078. eou = 0 '                                                             end of universe
  2079. fb$ = "" '                                                            landing feedback
  2080. flx = 0 '                                                             where to plot flag
  2081. fuel! = h
  2082. hover = 1 '                                                           start safe
  2083. ideal! = 2.7 '                                                        autopilot speed
  2084. inpause = 0
  2085. jf = -1 '                                                             jump to feature
  2086. LGMc = 1 '                                                            little green man color
  2087. lmsl = blue '                                                         LM shield & laser
  2088. lob = 0 '                                                             landed on Borg
  2089. lock1 = 0 '                                                           radar tracking
  2090. lockfuel = 0
  2091. ma = 0 '                                                              malfunction angle
  2092. magic = 0 '                                                           landing
  2093. mes$(0) = "" '                                                        messages ^ landing eval
  2094. mes$(1) = "" '                                                        radiation, landing comments
  2095. ok = 0 '                                                              landing status
  2096. panelinit = 0 '                                                       instruments
  2097. paraf = 0 '                                                           parachute flag
  2098. pif = -1 '                                                            counter for instruments
  2099. platform = 0 '                                                        for detached DS
  2100. power = opower '                                                      thrust factor
  2101. powerloss = 0 '                                                       random malfunction
  2102. px! = 320 '                                                           vehicle x
  2103. py! = 70 '                                                            vehicle y
  2104. radiationdeath = 0 '                                                  rads > 1000
  2105. rads = 0 '                                                            radiation count
  2106. rlink = 0 '                                                           LM/CM radio link
  2107. rmin = RND * 23 '                                                     stars right ascension 0 - 23
  2108. dmin = (INT(RND * 18) - 9) * t '                                      stars declination -90 to 90
  2109. sia = 0 '                                                             shells in air
  2110. sspinit1 = 0
  2111. sspinit2 = 0
  2112. starinit = 0
  2113. tfollow = 0 '                                                         terrain following
  2114. tmt! = 0 '                                                            to move total
  2115. wa = 0 '                                                              wanted angle
  2116. vert = 1 '                                                            vertical autopilot on
  2117. vsd = 0 '                                                             vehicle severely damaged
  2118.  
  2119. Setcolor
  2120. GetSurface gh
  2121.  
  2122. IF demo THEN
  2123.     auto = 0
  2124.     px! = sf(6, 2) - 3130 '                                           TMA
  2125.     py! = 130
  2126.     sf = 6 '                                                          surface feature
  2127.     suri = 3130 '                                                     surface index
  2128.     vx! = 0 '                                                         not moving
  2129.     vy! = 0
  2130.     a = RND + t
  2131.     IF RND > pf! THEN a = -a
  2132.     sf = 4
  2133.     suri = RND * q1
  2134.     px! = 320
  2135.     thrust! = 95
  2136.     vx! = SGN(a) * 5
  2137.     vy! = RND + 1
  2138.  
  2139. ERASE exv, ei, ek, rtl!, rtlc, shx, shd
  2140.  
  2141. mes$(0) = "F1 FOR HELP AND INFORMATION"
  2142. IF ufof > 0 THEN mes$(1) = "Alien on the loose!" '                    10% active
  2143. IF LEDtri THEN LEDc = green
  2144. GOSUB ReadLM
  2145. start2! = TIMER '                                                     elapsed time clock
  2146. sec = 0
  2147. min = 0
  2148.  
  2149. PlotGround:
  2150. IF crash = 0 THEN
  2151.     surd = SGN(tmt!) '                                                direction
  2152.     tomo = INT(ABS(tmt!)) '                                           to move
  2153.     IF tomo > (q3 - gs) THEN tomo = q3 - gs
  2154.     tmt! = tmt! - tomo * surd '                                       to move total
  2155.     suri = suri + tomo * surd '                                       surface index
  2156.     GOSUB slimit '                                                    limit values to 0-6399
  2157.          
  2158. IF gh = -1 THEN '                                                     ground height = flat
  2159.     LINE (gs, q4)-(q3, q4), gray
  2160.     GOTO stuff
  2161.  
  2162. FOR x = gs TO q3 '                                                    graphics start to 639
  2163.     z = (suri + x) MOD q1
  2164.     tc = gray
  2165.     IF (z >= sf(5, 0)) AND (z <= sf(5, 1)) THEN
  2166.         PSET (x, glmax), tc '                                         optional McD fix
  2167.     ELSE
  2168.         IF (z >= sf(7, 0)) AND (z <= sf(7, 1)) THEN '                 Surveyor
  2169.             y = glmax
  2170.         ELSE
  2171.             y = gety(x)
  2172.         END IF
  2173.         SELECT CASE gstyle
  2174.             CASE IS = 0 '                                             solid
  2175.                 LINE (x, y)-(x, glmax), tc
  2176.             CASE IS = 5 '                                             solid
  2177.                 LINE (x, y)-(x, glmax), tc
  2178.             CASE IS = 1 '                                             fancy
  2179.                 LINE (x, glmax)-(x, y), black2
  2180.                 LINE -(x, glmax), tc, , z + y
  2181.                 PSET (x, y), tc
  2182.             CASE IS = 2
  2183.                 LINE (x, y)-(x, glmax), tc
  2184.                 ty = y + 5
  2185.                 IF ty < glmax THEN
  2186.                     LINE (x, ty)-(x, glmax - 1), black, , &HFEFE
  2187.                 END IF
  2188.             CASE ELSE '                                               minimal or tiling
  2189.                 LINE (x, glmax)-(x, y), black2
  2190.                 LINE -(x, y + 3), tc
  2191.         END SELECT
  2192.     END IF
  2193.  
  2194. IF gstyle > 3 THEN Tile
  2195.  
  2196. stuff:
  2197. FOR i = 1 TO t
  2198.     ' Surv before IBM+TMA, IBM before TMA, LGM last
  2199.     '              1 2 3 4 5 6 7 8 9 0
  2200.     j = VAL(MID$("01070802040506091003", (i - 1) * 2 + 1, 2))
  2201.     z = VAL(MID$("80000080000080000000", (j - 1) * 2 + 1, 2))
  2202.     fb = sf(j, 0) - z
  2203.     fe = sf(j, 1) + z
  2204.     c1 = (fe >= (suri + gs)) AND (fb <= (suri + q3))
  2205.     c2 = ((fe + q1) >= (suri + gs)) AND ((fb + q1) <= (suri + q3))
  2206.     IF c1 OR c2 THEN
  2207.         sf = 0
  2208.         IF sf(j, 2) = -1 THEN GOTO nf
  2209.         sf = j
  2210.         x = sf(sf, 0) - suri
  2211.         z = sf(sf, 1) - suri
  2212.  
  2213.         IF (j = 1) AND (x < 0) AND (suri > 3000) THEN x = x + q1: z = z + q1
  2214.         bolthitf = (skyoff = 0) AND (boltx >= x) AND (boltx <= z) AND (exl(1) <> 9999)
  2215.         IF j = 1 THEN
  2216.             Area51 f$(40)
  2217.             IF (cut = 0) AND (LEFT$(mes$(1), 7) = "AREA 51") THEN
  2218.                 GOSUB CutOrOutOfFuel
  2219.             END IF
  2220.         END IF
  2221.         IF j = 2 THEN CarWash
  2222.         IF j = 3 THEN LGM fc
  2223.         IF j = 4 THEN Volcano
  2224.         IF j = 5 THEN McD
  2225.         IF j = 6 THEN TMA
  2226.         IF j = 7 THEN Surveyor
  2227.         IF j = 8 THEN IBM
  2228.         IF j = 9 THEN Hollywood
  2229.         IF j = t THEN Grave x, fb$
  2230.     END IF
  2231.     nf:
  2232.  
  2233. CommandModule: '                                                      27 * 9
  2234. IF ek(0) = -1 THEN RETURN
  2235. cminview = 1
  2236. tx = localize(ex(0), 14, 14)
  2237. IF tx = 999 THEN cminview = 0: GOTO nocm
  2238. x1 = tx - 14
  2239. x2 = tx + 14
  2240.  
  2241. VIEW SCREEN(gs + 1, 0)-(q3, q4) '                                     protect panel
  2242. LINE (x1 + 0, 18)-(x1 + 26, 26), black2, BF
  2243. FOR z = 1 TO 27
  2244.     LINE (x1 + z, 17)-(x1 + z, 26), white, , cmp&(z)
  2245.  
  2246. CMshadow tx, x1, x2 '                                                 optional
  2247.  
  2248. sd! = ABS(exv(0)) - ABS(vx!) '                                        speed diff
  2249. dbc = ABS(px! - tx)
  2250.  
  2251. IF (py! < h) AND (dbc < 50) AND (ABS(sd!) < .06) THEN
  2252.     rlink = t
  2253.     LINE (LMrx(1), LMry(1))-(tx + 8, 27), green, , RND * &H7FFF
  2254.     IF (cmleaving + convo) = 0 THEN
  2255.         mes$(0) = "Establishing link with Campbell soup cans and string"
  2256.         sct! = 2
  2257.         convo = 1
  2258.     END IF
  2259.     IF sc! = 0 THEN sc! = TIMER + sct! '                              start conversation in xs
  2260.     IF TIMER > sc! THEN
  2261.         convo = convo + 1
  2262.         IF convo > (clines + 1) THEN
  2263.             sc! = 0
  2264.             convo = 0
  2265.             cmleaving = 1
  2266.         ELSE
  2267.             mes$(0) = convo$(convo)
  2268.             sc! = TIMER + sct!
  2269.         END IF
  2270.     END IF
  2271.      
  2272. nocm:
  2273. rlink = rlink - 1 - (rlink = 0) '                                     allows brief radio interruption
  2274. IF rlink = 0 THEN '                                                   lost awhile ago
  2275.     IF convo THEN mes$(0) = " " '                                     clear current dialogue
  2276.     convo = 0 '                                                       stop conversation
  2277.     sc! = 0 '                                                         talk timer
  2278.  
  2279. IF cmleaving AND cminview THEN '                                      CM exhaust
  2280.     ty = 22
  2281.     LINE (x1, ty - 2)-(x1, ty + 2), yellow
  2282.     LINE -(x1 - 15, ty), yellow
  2283.     LINE -(x1, ty - 2), yellow
  2284.  
  2285. liftoff: '                                                            forced seperation or surface launch
  2286. IF (contact OR liftoff) AND (cwd < 69) AND (py! > 322) THEN
  2287.     dead$ = "HIT CAR WASH"
  2288.     RETURN
  2289.  
  2290. IF contact THEN vx! = 0
  2291. IF lob THEN vx! = exv(2): a = 0 '                                     landed on Borg
  2292.  
  2293. goy = -h '                                                            AS go y
  2294. IF ASO THEN '                                                         ascent stage only
  2295.     IF fuel! = 0 THEN RETURN
  2296.     thrust! = h
  2297.     falling = 0
  2298.     platform = 0
  2299.     IF lob THEN pminy = borgt
  2300.     power = opower
  2301.     thrust! = th '                                                    simulate explosive seperation
  2302.     platform = 22 '                                                   deflect flame from DS
  2303.     IF contact THEN
  2304.         falling = 0 '                                                 DS already on surface
  2305.     ELSE
  2306.         falling = 1 '                                                 DS in air
  2307.         goy = py! - 20 '                                              go y - not to screen top
  2308.     END IF
  2309.     LINE (gs, 30)-(q3, q4), 0, BF '                                   erase "space" area
  2310.     pminx = q1: pmaxx = -pminx
  2311.     pminy = q1: pmaxy = -pmaxy
  2312.     FOR i = 279 TO rp '                                               draw descent stage
  2313.         c = LMc(i)
  2314.         IF c < 0 THEN c = fuel
  2315.         PSET (LMrx(i), LMry(i)), c
  2316.         IF LMrx(i) < pminx THEN pminx = LMrx(i)
  2317.         IF LMrx(i) > pmaxx THEN pmaxx = LMrx(i)
  2318.         IF LMry(i) < pminy THEN pminy = LMry(i)
  2319.         IF LMry(i) > pmaxy THEN pmaxy = LMry(i)
  2320.     NEXT i
  2321.     GOSUB flevel
  2322.     IF platform > 0 THEN deflectat = pminy
  2323.     zz = pmaxy - pminy
  2324.     GET (pminx, pminy)-(pmaxx, pmaxy), gbuff() '                      save descent stage
  2325.     LINE (gs, 30)-(q3, q4), 0, BF '                                   erase "space" area
  2326.  
  2327.     ta = (a + tsix) MOD tsix
  2328.     px! = px! - t * s!(ta)
  2329.     py! = py! - 15 * c!(ta) '                                         explosive seperation
  2330.  
  2331. wASO = ASO
  2332. ASO = 1
  2333. GOSUB ReadLM
  2334. IF wASO = 0 THEN fuel! = h
  2335. IF vsd THEN LMdistort
  2336.  
  2337. IF contact THEN
  2338.     dropvx! = 0
  2339.     IF lob AND (ABS(px! - center) > 2) THEN dropvx! = exv(1)
  2340.     dropvy! = 0
  2341.     dropvx! = vx!
  2342.     dropvy! = vy!
  2343.  
  2344. IF lob OR (contact = 0) THEN
  2345.     wa = 0
  2346.     wa = SGN(-exv(0)) * 20 '                                          want angle
  2347.     IF wa = 0 THEN wa = -20
  2348.  
  2349. sauto = auto: auto = 1
  2350. contact = 0
  2351. cut = 0
  2352. dump = 0
  2353. hover = 0
  2354. liftoff = 1
  2355. lminx = pminx
  2356. lock1 = 0
  2357. lockfuel = 0
  2358. lpass = 0
  2359. IF wASO = 0 THEN ma = 0
  2360. mes$(0) = ""
  2361. mes$(1) = ""
  2362. np = 0
  2363. paraf = 0
  2364. pcontact = 0
  2365. powerloss = 0
  2366. psuri = suri
  2367. py! = py! - 2 '                                                       fool CheckHit
  2368. svert = vert
  2369. vert = 0
  2370.  
  2371. DO: _LIMIT mdelay * 1.5
  2372.     IF py! < 280 THEN GOSUB angle '                                   make a=wa (angle=wanted)
  2373.     GOSUB Plotscreen
  2374.     np = np + 1
  2375.     IF np >= t THEN GOSUB CheckHit
  2376.     z = (sy1 + sy2) / 2 - 2
  2377.     IF (deflectat > 0) AND (z > deflectat) AND (z > deflectat) THEN contact = 1
  2378.     IF contact THEN dead$ = "NOT YOUR DAY": EXIT DO
  2379.     lpass = lpass + 1
  2380.     IF thrust! = th THEN thrust! = h
  2381.     IF vsd THEN '                                                     very severe damage
  2382.         thrust! = h - (lpass + RND) '                                 slowly drop power
  2383.         IF thrust! < 50 THEN thrust! = 50 + RND
  2384.         IF RND > .95 THEN
  2385.             dead$ = "STRUCTURAL FAILURE"
  2386.             EXIT DO
  2387.         END IF
  2388.     END IF
  2389.     GOSUB KeyAndMouse
  2390.     IF LEN(dead$) THEN GOTO endl
  2391.     IF lob OR ((platform > 0) AND (falling = 1)) THEN
  2392.         pminx = pminx + dropvx!
  2393.         pmaxx = pmaxx + dropvx!
  2394.         pminy = pminy + dropvy!
  2395.         pmaxy = pmaxy + dropvy!
  2396.         IF lob = 0 THEN
  2397.             dropvy! = dropvy! + .6
  2398.             dropy! = gety(-(pminx + nx))
  2399.             IF pmaxy < dropy! THEN
  2400.                 lminx = pminx
  2401.                 lminy = dropy! - zz
  2402.                 deflectat = pminy
  2403.             ELSE
  2404.                 pminx = lminx
  2405.                 pminy = lminy
  2406.                 psuri = suri
  2407.                 pcontact = 1
  2408.                 falling = 0
  2409.             END IF
  2410.         END IF
  2411.     ELSE
  2412.         pminx = lminx + (psuri - suri)
  2413.     END IF
  2414.     IF cut THEN lpass = 0
  2415.     IF wASO THEN
  2416.         IF (py! <= goy) AND (cut = 0) THEN EXIT DO
  2417.     ELSE
  2418.         IF pcontact OR (pminx < gs) OR (pminx > 580) THEN EXIT DO
  2419.         IF (cut = 0) AND (py! <= goy) THEN
  2420.             hover = 1
  2421.             GOSUB Autopilot
  2422.             IF falling = 0 THEN EXIT DO
  2423.         END IF
  2424.     END IF
  2425. LOOP UNTIL (alt! > h) OR LEN(dead$)
  2426.  
  2427. endl:
  2428. auto = sauto
  2429. crash = 0
  2430. deflectat = 0
  2431. liftoff = 0
  2432. lock1 = 0
  2433. platform = 0
  2434. vert = svert
  2435.  
  2436. ReadLM:
  2437. LMbloads
  2438. IF ASO THEN '                                                         ascent stage only
  2439.     lp = 294
  2440.     nx = 16
  2441.     ny = 9
  2442.     rp = 302
  2443.     th1 = 170
  2444.     th2 = 198
  2445.     vmass = 60
  2446. ELSE '                                                                AS&DS 34*36
  2447.     lp = 696 '                                                        left pad
  2448.     nx = 17 '                                                         center x (for rotating)
  2449.     ny = 18 '                                                         center y
  2450.     rp = 705 '                                                        right pad
  2451.     th1 = 449 '                                                       left thruster
  2452.     th2 = 483 '                                                       right thruster
  2453.     vmass = h '                                                       full mass
  2454.  
  2455. nred = 0 '                                                            number red (volcanic heating)
  2456. temp = 0 '                                                            temperature
  2457. IF bw = 0 THEN PALETTE gasoline, 24
  2458. xp = 97 ' radar
  2459. wi = LMx(rp) - LMx(lp) + 1 '                                          width
  2460. wi2 = wi \ 2
  2461.  
  2462. IF invincible THEN c = gold ELSE c = gray '                           thruster color
  2463. FOR i = 1 TO rp
  2464.     LMx(i) = LMx(i) - nx
  2465.     LMy(i) = LMy(i) - ny
  2466.     IF (LMc(i) = gray) OR (LMc(i) = gold) THEN LMc(i) = c '           thrusters
  2467.     IF LMc(i) < 0 THEN LMc(i) = fuel '                                fuel
  2468.     LMoc(i) = LMc(i)
  2469. GOSUB LMcolors
  2470. ' --------------------------------------------------------------------------
  2471. d1:
  2472. DATA 27,"Elapsed time"
  2473. DATA 36,"Distance to McD"
  2474. DATA 45,"CPU"
  2475. DATA 54,"Rads/temperature"
  2476. DATA 86,"Fuel"
  2477. DATA 126,"Altitude"
  2478. DATA 166,"Horizontal velocity"
  2479. DATA 206,"Vertical velocity"
  2480. DATA 244,"Main thrust"
  2481. DATA 277,"Sideways thrust"
  2482. DATA 307,"Autopilot (full)"
  2483. DATA 322,"Hover control"
  2484. DATA 337,"Vertical automatic"
  2485.  
  2486. DATA "Scored on vertical & horizontal speed:"
  2487. DATA "0.00 - 0.50 Excellent"
  2488. DATA "0.51 - 1.00 Good"
  2489. DATA "1.01 - 2.00 Fair"
  2490. DATA "2.01 - 3.00 Poor"
  2491. DATA ""
  2492. DATA "Landing surface should be near flat,"
  2493. DATA with required ending angle under 5ø.
  2494. DATA ""
  2495. DATA Based on a 1974 program running on a
  2496. DATA DEC PDP/11 with GT40 vector display
  2497. DATA terminal at the University of Alberta.
  2498. DATA The graphic at top left is usually a Henon
  2499. DATA "plot, dealing with the stability of orbits."
  2500. DATA The face appearing in TMA-1 when it shoots
  2501. DATA "is Cybill Shepherd. If you land on TMA-1,"
  2502. DATA it displays a Mandelbrot. The semaphores
  2503. DATA "use proper flag positions, and the Morse"
  2504. DATA code in the McDonalds sign is real too.
  2505. DATA "Little Green Man can be turned into a pile"
  2506. DATA of ashes.  Beware the beach balls of IBM!
  2507. DATA ""
  2508. DATA F2 for a demo mode showing most features.
  2509. DATA ""
  2510. DATA "Esc or <: Back to Lander   > Next page"
  2511.  
  2512. d2:
  2513. DATA "ud        main thrust"
  2514. DATA "<>        side thrust/angle"
  2515. DATA "Shift ud  move up"
  2516. DATA "Shift <>  move left/right"
  2517. DATA "<>        ground back/forward"
  2518. DATA "space     abort/feature cycle"
  2519. DATA "Bkspace   random star position"
  2520. DATA "Esc       quit"
  2521. DATA "01234     stars off/on/info"
  2522. DATA "aA        autopilot on/off/McD"
  2523. DATA "b         goto Borg"
  2524. DATA "B         goto black hole"
  2525. DATA "c         cut engine"
  2526. DATA "C         clock(s) on/off"
  2527. DATA "d         dump fuel"
  2528. DATA "D         restart with defaults"
  2529. DATA "fF        fuel lock/unlimited"
  2530. DATA "G         new ground"
  2531. DATA "h         hover"
  2532. DATA "I         invincible mode"
  2533. DATA "k         kill (fire laser)"
  2534. DATA "wlemtsiHg goto surface feature"
  2535. DATA "L         level ground"
  2536. DATA "M         Magic landing!"
  2537. DATA "n         nation (flag)"
  2538. DATA "o         goto comet"
  2539. DATA "O         goto EPCOR"
  2540. DATA "p         pause"
  2541. DATA "P         parachute"
  2542. DATA "r         radar"
  2543. DATA "R         rendesvous with CM"
  2544. DATA "T         thrust accuracy"
  2545. DATA "u         instruments"
  2546. DATA "v         vertical automatic"
  2547. DATA "y         swap mouse buttons"
  2548. DATA "z         self-destruct"
  2549. DATA ".         terrain following"
  2550. DATA "F2        demo mode (compressed)"
  2551. DATA "F3        sky features"
  2552. DATA "F4        constant black holes"
  2553. DATA "F5        panel/instruments"
  2554. DATA "F6        drop descent stage"
  2555. DATA "F7        map at top"
  2556. DATA "F8        shields (uses fuel)"
  2557. DATA "F9/F10    LED color/tri-color"
  2558. DATA "PgDn/Up   slower/faster"
  2559. DATA "< Previous page   > Next page"
  2560.  
  2561. d3:
  2562. DATA "/  green/amber/b&w/regular screen"
  2563. DATA "+  zoom in starfield"
  2564. DATA "-  zoom out starfield"
  2565. DATA "\  drop bomb"
  2566. DATA ".  terrain following"
  2567. DATA "_  star twinkle"
  2568. DATA "j  DeathStar rotation"
  2569. DATA "|  generate all star files (hours!)"
  2570. DATA "x  more/less stars"
  2571. DATA "X  regenerate current star file"
  2572. DATA "Q  oscar (LGM flag colors)"
  2573. DATA "=  show LM data"
  2574. DATA "[  crude black & white"
  2575. DATA "]  UFO toggle"
  2576. DATA "U  ground tiling style"
  2577. DATA "ctrl-c or -s: SCREEN capture"
  2578. DATA "alt-Enter: fullscreen toggle"
  2579. DATA ""
  2580. DATA "< Previous page   > Next page"
  2581.  
  2582. d4:
  2583. DATA "      Programmed by:   R. Frost"
  2584. DATA "                       Edmonton, Alberta, Canada"
  2585. DATA ""
  2586. DATA "                       rfrost@mail.com "
  2587. DATA ""
  2588. DATA ""
  2589. DATA " 1) 2001 A Space Odyssey: TMA-1, HAL, CM/LM chatter"
  2590. DATA " 2) Star Trek: warp messages, phasers, shield, Borg"
  2591. DATA " 3) Lost in Space: black hole warning"
  2592. DATA " 4) Southpark: black hole at 3:50 (Tree-fiddy! - Chef)"
  2593. DATA " 5) Simpsons: LGM saying he has semaphore flags"
  2594. DATA " 6) Rocky & Bullwinkle: a hall of Montezuma (car wash)"
  2595. DATA " 7) Bonanza: car wash traverse generates a Hop Sing quote"
  2596. DATA " 8) SCTV: CM/LM chatter"
  2597. DATA " 9) a McDonalds on the Moon, and an instrument for it"
  2598. DATA "10) Little Green Man wiggles ears & reacts to LM exhaust"
  2599. DATA "11) pirate books & movies: CM/LM chatter"
  2600. DATA "12) Command Module leaves you stranded"
  2601. DATA "13) a Steve Martin quote precedes black hole death"
  2602. DATA "14) half the time the USSR flag is planted"
  2603. DATA "15) Cybil Shepherd's face appears in TMA-1 when it fires"
  2604. DATA "16) Halley's Comet is renamed Halle Berry"
  2605. DATA "17) digital, analog, and binary clocks!"
  2606. DATA "18) End Of The Universe is signaled by Chicken Little"
  2607. DATA "19) Mt. Etna spews volcanic cheese"
  2608. DATA "20) a parachute that doesn't work in a vacuum"
  2609. DATA "21) Area 51 is the first level landing zone"
  2610. DATA "22) IBM weapon is a fishing float or beach ball"
  2611. DATA ""
  2612. DATA "< Previous page   Esc or >: Back to Lander"
  2613.  
  2614. leds:
  2615. DATA a,0,-2,1,-2
  2616. DATA b,1,-2,1,-1
  2617. DATA c,1,-1,1,0
  2618. DATA d,0,0,1,0
  2619. DATA e,0,-1,0,0
  2620. DATA f,0,-2,0,-1
  2621. DATA g,0,-1,1,-1
  2622.        
  2623. DATA 0,abcdef,1,bc,2,abged,3,abgcd,4,fgbc,5,acdfg,6,acdefg,7,abc,8,abcdefg,9,abcdfg,10,g,11,def
  2624.  
  2625. features:
  2626. '               x   y  lz
  2627. DATA "Area 51",65,40,45
  2628. DATA "Car Wash",100,44,130
  2629. DATA "Little Green Man",12,0,70
  2630. DATA "Etna",10,49,20
  2631. DATA "McDonalds",38,0,80
  2632. DATA "TMA-1",45,71,80
  2633. DATA "Surveyor",28,0,80
  2634. DATA "IBM",50,45,90
  2635. DATA "Hollywood",170,0,0
  2636. DATA "a grave",68,49,98
  2637.  
  2638. MorseData:
  2639. DATA a,.-,b,-...,c,-.-.,d,-..,e,.,f,..-.,g,--.
  2640. DATA h,....,i,..,j,.---,k,-.-,l,.-..,m,--,n,-.
  2641. DATA o,---,p,.--.,q,--.-,r,-.-,s,...,t,-,u,..-
  2642. DATA v,...-,w,.--,x,-..-,y,-.--,z,--..,1,.----,2,..---
  2643. DATA 3,...--,4,....-,5,.....,6,-...,7,--..,8,---..,9,----.
  2644. DATA 0,-----,!,..--.,$,...-..-,&,.-...
  2645.  
  2646. warp:
  2647. DATA "The Rockwell warranty is now void"
  2648. DATA "Hope we don't collide with Klingons!"
  2649. DATA "You need a vacation, Jim!  - Bones!"
  2650. DATA "It's a long way to Tipperary!"
  2651. DATA "Do we know this universe?  - Spock"
  2652. DATA "My miniskirt is getting shorter! - Uhuru"
  2653. DATA "Da engines kanna tayke much more! - Scotty"
  2654. DATA "Keptin, are you insane? - Chekhov"
  2655. DATA "Hit 10 and we die!"
  2656.  
  2657. radcomments:
  2658. DATA "has caused genetic damage"
  2659. DATA "causes glowing in the dark"
  2660. DATA "5 years"
  2661. DATA "1 year"
  2662. DATA "6 months"
  2663. DATA "1 month"
  2664. DATA "1 week"
  2665. DATA "8 hours"
  2666. DATA "5 minutes"
  2667. DATA "has killed you - press Esc"
  2668.  
  2669. skycrud:
  2670. DATA CM,14,14
  2671. DATA DS,150,150
  2672. DATA BO,58,46
  2673. DATA BH,200,200
  2674. DATA Wo,90,90
  2675. DATA Co,20,100
  2676. DATA AL,40,40
  2677. DATA ZZ,1,1
  2678.  
  2679. semadata:
  2680. DATA a 1,225,180
  2681. DATA b 2,270,180
  2682. DATA c 3,315,180
  2683. DATA d 4,0,180
  2684. DATA e 5,180,45
  2685. DATA f 6,180,90
  2686. DATA g 7,180,135
  2687. DATA h 8,270,225
  2688. DATA i 9,225,315
  2689. DATA j,0,90
  2690. DATA k 0,225,0
  2691. DATA l,225,45
  2692. DATA m,225,90
  2693. DATA n,225,135
  2694. DATA o,270,315
  2695. DATA p,270,0
  2696. DATA q,270,45
  2697. DATA r,270,90
  2698. DATA s,270,135
  2699. DATA t,315,0
  2700. DATA u,315,45
  2701. DATA v,0,135
  2702. DATA w,45,90
  2703. DATA x,45,135
  2704. DATA y,315,90
  2705. DATA z,135,90
  2706. DATA " ",180,180
  2707. DATA !,0,0
  2708.  
  2709. say:
  2710. DATA "The time is 1234"
  2711. DATA "Welcome to the Moon"
  2712. DATA "I am a little green man"
  2713. DATA "I have semaphore flags"
  2714. DATA "R Frost is a nerd!"
  2715. DATA "abcdefghijklmnopqrstuvwxyz"
  2716.  
  2717. BigM: '                                                               37 * 16
  2718. DATA "          X               X          "
  2719. DATA "         X X             X X         "
  2720. DATA "        X   X           X   X        "
  2721. DATA "       X     X         X     X       "
  2722. DATA "      X       X       X       X      "
  2723. DATA "     X         X     X         X     "
  2724. DATA "     X         X     X         X     "
  2725. DATA "    X           X   X           X    "
  2726. DATA "    X           X   X           X    "
  2727. DATA "   X             X X             X   "
  2728. DATA "   X             X X             X   "
  2729. DATA "  X              XXX              X  "
  2730. DATA " X                                 X "
  2731. DATA " X                                 X "
  2732. DATA "X                                   X"
  2733. DATA "X                                   X"
  2734. '     1234567890123456789012345678901234567
  2735. '              1         2         3
  2736. tinyfontd:
  2737. DATA 0,7,5,5,5,7
  2738. DATA 1,2,6,2,2,7
  2739. DATA 2,7,1,7,4,7
  2740. DATA 3,7,1,7,1,7
  2741. DATA 4,5,5,7,1,1
  2742. DATA 5,7,4,7,1,7
  2743. DATA 6,7,4,7,5,7
  2744. DATA 7,7,1,1,1,1
  2745. DATA 8,7,5,7,5,7
  2746. DATA 9,7,5,7,1,7
  2747. DATA .,0,0,0,0,2
  2748. DATA -,0,0,1,0,0
  2749. DATA ":",0,2,0,2,0
  2750. DATA " ",0,0,0,0,0
  2751.  
  2752. lmshow:
  2753. FOR pass = 1 TO 2
  2754.     CLS
  2755.     FOR i = 1 TO rp
  2756.         x = (LMx(i) + 17 - ASO) * 16 + 30 + (pass = 2)
  2757.         y = (LMy(i) + 18 - ASO * 9) * 8 + t
  2758.         IF pass = 1 THEN z$ = LTRIM$(STR$(LMc(i))) ELSE z$ = RIGHT$("  " + STR$(i), 3)
  2759.         IF LEN(z$) = 1 THEN z$ = "0" + z$
  2760.         c = LMc(i)
  2761.         TinyFont z$, x + 3, y + 3, c
  2762.     NEXT i
  2763.     FOR i = 1 TO 35 '                                                 line of numbers at top
  2764.         z$ = RIGHT$(" " + LTRIM$(STR$(i)), 2)
  2765.         TinyFont z$, (i - 1) * 16 + 33, 4, gray
  2766.         x = (i - 1) * 16 + 30 + 16
  2767.         LINE (x, 0)-(x, 320), red
  2768.     NEXT i
  2769.     FOR i = 1 TO 36 '                                                 columb of numbers at left
  2770.         z$ = RIGHT$(" " + LTRIM$(STR$(i)), 2)
  2771.         TinyFont z$, 8, i * 8 + 13, gray
  2772.         y = i * 8 + t + 8 + 1
  2773.         LINE (0, y)-(q3, y), red
  2774.     NEXT i
  2775.     LINE (0, 0)-(q3, 320), red, B
  2776.     _DISPLAY
  2777.     SLEEP
  2778. NEXT pass
  2779. ' -------------------------------------------------------------------------------------------------------x
  2780. SUB mHelp
  2781.     VIEW: CLS
  2782.     hp = 1
  2783.     DO
  2784.         CLS
  2785.         IF hp = 1 THEN GOSUB Help1
  2786.         IF hp = 2 THEN GOSUB Help2
  2787.         IF hp = 3 THEN GOSUB Help3
  2788.         IF hp = 4 THEN GOSUB credits
  2789.         timemachine
  2790.         DO: _LIMIT 30
  2791.             i$ = INKEY$
  2792.         LOOP UNTIL LEN(i$)
  2793.         IF LEN(i$) = 1 THEN k = ASC(i$) ELSE k = ASC(RIGHT$(i$, 1))
  2794.         hp = hp + (k = 75) - (k = 77)
  2795.         IF (k = 27