Author Topic: subscript out of range on line 230  (Read 2429 times)

0 Members and 1 Guest are viewing this topic.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
subscript out of range on line 230
« on: December 08, 2020, 09:17:04 pm »
Code: QB64: [Select]
  1.  
  2. WIDTH 80, 50
  3.  
  4. CONST shotDelay = 0.03
  5. CONST fireBeep = "L64O3CEGAA"
  6. CONST shipHitBeep = "L64O1EEEEEL16CC"
  7.  
  8. DIM SHARED battleScreen(1 TO 80, 1 TO 45, 1 TO 2)
  9.  
  10.  
  11. FOR fillY = 1 TO 45
  12.     FOR fillX = 1 TO 80
  13.         battleScreen(fillX, fillY, 1) = 32
  14.         battleScreen(fillX, fillY, 2) = 0
  15.     NEXT fillX
  16. NEXT fillY
  17.  
  18.  
  19. COLOR 0, 0
  20. LOCATE 1, 1
  21.  
  22.  
  23.  
  24. CALL Battle
  25.  
  26. FUNCTION locateToBegin () STATIC
  27.     starting = starting + 1
  28.     locateToBegin = starting
  29.  
  30.  
  31. SUB PrintBattleScreen ()
  32.     CLS: LOCATE 1, 1
  33.     FOR printY = 1 TO 45
  34.         FOR printX = 1 TO 80
  35.             IF printX <> 80 THEN
  36.                 COLOR battleScreen(printX, printY, 2), 0
  37.                 PRINT CHR$(battleScreen(printX, printY, 1));
  38.             ELSE
  39.                 COLOR battleScreen(printX, printY, 2), 0
  40.                 PRINT CHR$(battleScreen(printX, printY, 1))
  41.             END IF
  42.         NEXT printX
  43.     NEXT printY
  44.  
  45. SUB RelocateSarien
  46.     espializerLeft = 80
  47.     espializerRight = 1
  48.     espializerTop = 45
  49.     espializerBottomn = 1
  50.     'there's gotta be an easier way to find the square radius of the espializer
  51.     'all i can thing of is many different FOR-NEXT loops
  52.     'any way is better than no way. so be it
  53.     'find the top
  54.     FOR scanningX = 1 TO 80
  55.         FOR scanningY = 1 TO 45
  56.             IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
  57.                 espializerTop = scanningY
  58.                 EXIT FOR
  59.             END IF
  60.         NEXT scanningY
  61.     NEXT scanningX
  62.     'find the bottom
  63.     FOR scanningX = 1 TO 80
  64.         FOR scanningY = 45 TO 1 STEP -1
  65.             IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
  66.                 espializerBottom = scanningY
  67.                 EXIT FOR
  68.             END IF
  69.         NEXT scanningY
  70.     NEXT scanningX
  71.     'find left
  72.     FOR scanningX = 1 TO 80
  73.         FOR scanningY = 1 TO 45
  74.             IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
  75.                 espializerLeft = scanningX
  76.                 EXIT FOR
  77.             END IF
  78.         NEXT scanningY
  79.     NEXT scanningX
  80.     'find right
  81.     FOR scanningX = 80 TO 1 STEP -1
  82.         FOR scanningY = 1 TO 45
  83.             IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
  84.                 espializerRight = scanningX
  85.                 EXIT FOR
  86.             END IF
  87.         NEXT scanningY
  88.     NEXT scanningX
  89.     'ok, now that i have the square radius, make sure the new coordinates won't be inside a 15 square radius
  90.     ' but they also need to be in the line of fire
  91.     getNewSarienPlace:
  92.     rndX = INT(RND * 76) + 2
  93.     rndY = INT(RND * 42) + 2
  94.     rndOrient = INT(RND * 4) + 1
  95.     IF rndOrient = 1 THEN sarienOrientation$ = "N"
  96.     IF rndOrient = 2 THEN sarienOrientation$ = "S"
  97.     IF rndOrient = 3 THEN sarienOrientation$ = "W"
  98.     IF rndOrient = 4 THEN sarienOrientation$ = "E"
  99.     ' don't let the Sarien's be within 15 squares of the Espializer. --maybe leter i'll build in the possibility for the star generator to explode but that might be too sq1
  100.     IF espializerLeft - 15 < rndX AND rndX < espializerRight + 15 AND espializerTop - 15 < rndY AND rndY < espializerBottom + 15 THEN
  101.         'need new coordinates
  102.         GOTO getNewSarienPlace
  103.     END IF
  104.  
  105.  
  106.     CALL DrawSarien(rndX, rndY, "S") 'sarienOrientation$) '   may not need "CALL" but like my game, i'm old school like that
  107.  
  108. SUB Battle
  109.     'randNum% = INT(RND * (max% - min% + 1)) + min%
  110.     xPos = INT(RND * 71) + 5
  111.     yPos = INT(RND * 41) + 5
  112.     intFacing = INT(RND * 4) + 1:
  113.     IF intFacing = 1 THEN
  114.         facing$ = "N"
  115.     ELSEIF intFacing = 2 THEN
  116.         facing$ = "S"
  117.     ELSEIF intFacing = 3 THEN
  118.         facing$ = "W"
  119.     ELSEIF intFacing = 4 THEN
  120.         facing$ = "E"
  121.     END IF
  122.     '    CALL DrawEspializer(xPos, yPos, facing$)
  123.     '    xPos2 = INT(RND * 71) + 5
  124.     '    yPos2 = INT(RND * 41) + 5
  125.     '    intFacing2 = INT(RND * 4) + 1: IF intFacing2 = 1 THEN facing$ = "N": IF intFacing2 = 2 THEN facing$ = "S": IF intFacing2 = 3 THEN facing$ = "W": IF intFacing2 = 4 THEN facing$ = "E"
  126.     CALL RelocateSarien
  127.     CALL PrintBattleScreen
  128.     CALL DrawSarien(xPos2, yPos2, "N")
  129.  
  130.     DO
  131.         whichMove$ = INKEY$
  132.         limX = 0: limY = 0
  133.         '        CALL PrintBattleScreen
  134.         SELECT CASE whichMove$
  135.             CASE CHR$(0) + "H" ' up
  136.                 IF yPos > 5 THEN
  137.                     IF yPos < 16 THEN
  138.                         limY = 1
  139.                     ELSE
  140.                         limY = yPos - 15
  141.                     END IF
  142.                     moveFlag = 1
  143.                     FOR testingX = xPos - 3 TO xPos + 3
  144.                         IF battleScreen(testingX, limY, 1) <> 32 THEN moveFlag = 0
  145.                     NEXT testingX
  146.                     IF moveFlag = 1 THEN '      needs xPos + / - 3
  147.                         CALL EraseEspializer(xPos, yPos, facing$)
  148.                         yPos = yPos - 1: facing$ = "N"
  149.                         CALL DrawEspializer(xPos, yPos, facing$)
  150.                         CALL PrintBattleScreen
  151.                     END IF
  152.                 END IF
  153.             CASE CHR$(0) + "K" ' left
  154.                 IF xPos > 5 THEN
  155.                     IF xPos < 16 THEN
  156.                         limX = 1
  157.                     ELSE
  158.                         limX = xPos - 15
  159.                     END IF
  160.                     moveFlag = 1
  161.                     FOR testingY = yPos - 3 TO yPos + 3
  162.                         IF battleScreen(limX, testingY, 1) <> 32 THEN moveFlag = 0
  163.                     NEXT testingY
  164.                     IF moveFlag = 1 THEN
  165.                         CALL EraseEspializer(xPos, yPos, facing$)
  166.                         xPos = xPos - 1: facing$ = "W"
  167.                         CALL DrawEspializer(xPos, yPos, facing$)
  168.                         CALL PrintBattleScreen
  169.                     END IF
  170.                 END IF
  171.             CASE CHR$(0) + "P" ' down
  172.                 IF yPos < 40 THEN
  173.                     IF yPos > 30 THEN
  174.                         limY = 45
  175.                     ELSE
  176.                         limY = yPos + 15
  177.                     END IF
  178.                     moveFlag = 1
  179.                     FOR testingX = xPos - 3 TO xPos + 3
  180.                         IF battleScreen(testingX, limY, 1) <> 32 THEN moveFlag = 0
  181.                     NEXT testingX
  182.                     IF moveFlag = 1 THEN
  183.                         CALL EraseEspializer(xPos, yPos, facing$)
  184.                         yPos = yPos + 1: facing$ = "S"
  185.                         CALL DrawEspializer(xPos, yPos, facing$)
  186.                         CALL PrintBattleScreen
  187.                     END IF
  188.                 END IF
  189.             CASE CHR$(0) + "M" ' right
  190.                 IF xPos < 75 THEN
  191.                     IF xPos > 65 THEN
  192.                         limX = 80
  193.                     ELSE
  194.                         limX = xPos + 15
  195.                     END IF
  196.                     moveFlag = 1
  197.                     FOR testingY = yPos - 3 TO yPos + 3
  198.                         IF battleScreen(limX, testingY, 1) <> 32 THEN moveFlag = 0
  199.                     NEXT testingY
  200.                     IF battleScreen(limX, yPos, 1) = 32 THEN
  201.                         CALL EraseEspializer(xPos, yPos, facing$)
  202.                         xPos = xPos + 1: facing$ = "E"
  203.                         CALL DrawEspializer(xPos, yPos, facing$)
  204.                         CALL PrintBattleScreen
  205.                     END IF
  206.                 END IF
  207.             CASE CHR$(27)
  208.                 END
  209.         END SELECT
  210.     LOOP UNTIL whichMove$ = CHR$(27)
  211.  
  212. SUB DrawSarien (centerX, centerY, orientation$)
  213.  
  214.     COLOR 10, 0
  215.     SELECT CASE orientation$
  216.         CASE "N"
  217.             IF locateToBegin = 1 THEN
  218.                 LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
  219.                 LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
  220.                 LOCATE centerY - 1, centerX + 0: PRINT CHR$(219)
  221.             END IF
  222.             battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
  223.             battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
  224.             battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
  225.         CASE "S"
  226.             IF locateToBegin = 1 THEN
  227.                 LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
  228.                 LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
  229.                 LOCATE centerY + 1, centerX + 0: PRINT CHR$(219)
  230.             END IF
  231.             battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
  232.             battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
  233.             battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
  234.         CASE "W"
  235.             IF locateToBegin = 1 THEN
  236.                 LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
  237.                 LOCATE centerY - 1, centerX + 0: PRINT CHR$(219)
  238.                 LOCATE centerY + 1, centerX + 0: PRINT CHR$(219)
  239.             END IF
  240.             battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
  241.             battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
  242.             battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
  243.         CASE "E"
  244.             IF locateToBegin = 1 THEN
  245.                 LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
  246.                 LOCATE centerY - 1, centerX - 1: PRINT CHR$(219)
  247.                 LOCATE centerY + 1, centerX - 1: PRINT CHR$(219)
  248.             END IF
  249.             battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
  250.             battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
  251.             battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
  252.     END SELECT
  253.  
  254. SUB EraseSerian (centerx, centery, orientation$)
  255.     SELECT CASE orientation$
  256.         CASE "N"
  257.             battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
  258.             battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
  259.             battleScreen(centerx + 0, centery - 1, 1) = 32: battleScreen(centerx + 0, centery - 1, 2) = 0
  260.         CASE "S"
  261.             battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
  262.             battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
  263.             battleScreen(centerx + 0, centery + 1, 1) = 32: battleScreen(centerx + 0, centery + 1, 2) = 0
  264.         CASE "W"
  265.             battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
  266.             battleScreen(centerx + 1, centery - 1, 1) = 32: battleScreen(centerx + 1, centery - 1, 2) = 0
  267.             battleScreen(centerx + 1, centery + 1, 1) = 32: battleScreen(centerx + 1, centery + 1, 2) = 0
  268.         CASE "E"
  269.             battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
  270.             battleScreen(centerx - 1, centery - 1, 1) = 32: battleScreen(centerx - 1, centery - 1, 2) = 0
  271.             battleScreen(centerx - 1, centery + 1, 1) = 32: battleScreen(centerx - 1, centery + 1, 2) = 0
  272.     END SELECT
  273.  
  274.  
  275. SUB DrawEspializer (centerX, centerY, orientation$)
  276.     SELECT CASE orientation$
  277.         CASE "E"
  278.             battleScreen(centerX - 4, centerY - 3, 1) = 219: battleScreen(centerX - 4, centerY - 3, 2) = 9
  279.             battleScreen(centerX - 3, centerY - 3, 1) = 219: battleScreen(centerX - 3, centerY - 3, 2) = 9
  280.             battleScreen(centerX - 2, centerY - 3, 1) = 219: battleScreen(centerX - 2, centerY - 3, 2) = 9
  281.             battleScreen(centerX - 1, centerY - 3, 1) = 219: battleScreen(centerX - 1, centerY - 3, 2) = 9
  282.             battleScreen(centerX - 0, centerY - 3, 1) = 219: battleScreen(centerX - 0, centerY - 3, 2) = 9
  283.             battleScreen(centerX - 4, centerY + 3, 1) = 219: battleScreen(centerX - 4, centerY + 3, 2) = 9
  284.             battleScreen(centerX - 3, centerY + 3, 1) = 219: battleScreen(centerX - 3, centerY + 3, 2) = 9
  285.             battleScreen(centerX - 2, centerY + 3, 1) = 219: battleScreen(centerX - 2, centerY + 3, 2) = 9
  286.             battleScreen(centerX - 1, centerY + 3, 1) = 219: battleScreen(centerX - 1, centerY + 3, 2) = 9
  287.             battleScreen(centerX - 0, centerY + 3, 1) = 219: battleScreen(centerX - 0, centerY + 3, 2) = 9
  288.             battleScreen(centerX + 0, centerY - 2, 1) = 219: battleScreen(centerX + 0, centerY - 2, 2) = 15
  289.             battleScreen(centerX + 1, centerY - 2, 1) = 219: battleScreen(centerX + 1, centerY - 2, 2) = 15
  290.             battleScreen(centerX + 2, centerY - 2, 1) = 219: battleScreen(centerX + 2, centerY - 2, 2) = 15
  291.             battleScreen(centerX + 1, centerY - 1, 1) = 219: battleScreen(centerX + 1, centerY - 1, 2) = 15
  292.             battleScreen(centerX + 2, centerY - 1, 1) = 219: battleScreen(centerX + 2, centerY - 1, 2) = 15
  293.             battleScreen(centerX + 3, centerY - 1, 1) = 219: battleScreen(centerX + 3, centerY - 1, 2) = 15
  294.             battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 15
  295.             battleScreen(centerX + 2, centerY + 0, 1) = 219: battleScreen(centerX + 2, centerY + 0, 2) = 15
  296.             battleScreen(centerX + 3, centerY + 0, 1) = 219: battleScreen(centerX + 3, centerY + 0, 2) = 15
  297.             battleScreen(centerX + 4, centerY + 0, 1) = 219: battleScreen(centerX + 4, centerY + 0, 2) = 15
  298.             battleScreen(centerX + 1, centerY + 1, 1) = 219: battleScreen(centerX + 1, centerY + 1, 2) = 15
  299.             battleScreen(centerX + 2, centerY + 1, 1) = 219: battleScreen(centerX + 2, centerY + 1, 2) = 15
  300.             battleScreen(centerX + 3, centerY + 1, 1) = 219: battleScreen(centerX + 3, centerY + 1, 2) = 15
  301.             battleScreen(centerX + 0, centerY + 2, 1) = 219: battleScreen(centerX + 0, centerY + 2, 2) = 15
  302.             battleScreen(centerX + 1, centerY + 2, 1) = 219: battleScreen(centerX + 1, centerY + 2, 2) = 15
  303.             battleScreen(centerX + 2, centerY + 2, 1) = 219: battleScreen(centerX + 2, centerY + 2, 2) = 15
  304.         CASE "W"
  305.             battleScreen(centerX + 0, centerY - 3, 1) = 219: battleScreen(centerX + 0, centerY - 3, 2) = 9
  306.             battleScreen(centerX + 1, centerY - 3, 1) = 219: battleScreen(centerX + 1, centerY - 3, 2) = 9
  307.             battleScreen(centerX + 2, centerY - 3, 1) = 219: battleScreen(centerX + 2, centerY - 3, 2) = 9
  308.             battleScreen(centerX + 3, centerY - 3, 1) = 219: battleScreen(centerX + 3, centerY - 3, 2) = 9
  309.             battleScreen(centerX + 4, centerY - 3, 1) = 219: battleScreen(centerX + 4, centerY - 3, 2) = 9
  310.             battleScreen(centerX + 0, centerY + 3, 1) = 219: battleScreen(centerX + 0, centerY + 3, 2) = 9
  311.             battleScreen(centerX + 1, centerY + 3, 1) = 219: battleScreen(centerX + 1, centerY + 3, 2) = 9
  312.             battleScreen(centerX + 2, centerY + 3, 1) = 219: battleScreen(centerX + 2, centerY + 3, 2) = 9
  313.             battleScreen(centerX + 3, centerY + 3, 1) = 219: battleScreen(centerX + 3, centerY + 3, 2) = 9
  314.             battleScreen(centerX + 4, centerY + 3, 1) = 219: battleScreen(centerX + 4, centerY + 3, 2) = 9
  315.             battleScreen(centerX - 2, centerY - 2, 1) = 219: battleScreen(centerX - 2, centerY - 2, 2) = 15
  316.             battleScreen(centerX - 1, centerY - 2, 1) = 219: battleScreen(centerX - 1, centerY - 2, 2) = 15
  317.             battleScreen(centerX - 0, centerY - 2, 1) = 219: battleScreen(centerX - 0, centerY - 2, 2) = 15
  318.             battleScreen(centerX - 2, centerY + 2, 1) = 219: battleScreen(centerX - 2, centerY + 2, 2) = 15
  319.             battleScreen(centerX - 1, centerY + 2, 1) = 219: battleScreen(centerX - 1, centerY + 2, 2) = 15
  320.             battleScreen(centerX - 0, centerY + 2, 1) = 219: battleScreen(centerX - 0, centerY + 2, 2) = 15
  321.             battleScreen(centerX - 3, centerY - 1, 1) = 219: battleScreen(centerX - 3, centerY - 1, 2) = 15
  322.             battleScreen(centerX - 2, centerY - 1, 1) = 219: battleScreen(centerX - 2, centerY - 1, 2) = 15
  323.             battleScreen(centerX - 1, centerY - 1, 1) = 219: battleScreen(centerX - 1, centerY - 1, 2) = 15
  324.             battleScreen(centerX - 3, centerY + 1, 1) = 219: battleScreen(centerX - 3, centerY + 1, 2) = 15
  325.             battleScreen(centerX - 2, centerY + 1, 1) = 219: battleScreen(centerX - 2, centerY + 1, 2) = 15
  326.             battleScreen(centerX - 1, centerY + 1, 1) = 219: battleScreen(centerX - 1, centerY + 1, 2) = 15
  327.             battleScreen(centerX - 4, centerY + 0, 1) = 219: battleScreen(centerX - 4, centerY + 0, 2) = 15
  328.             battleScreen(centerX - 3, centerY + 0, 1) = 219: battleScreen(centerX - 3, centerY + 0, 2) = 15
  329.             battleScreen(centerX - 2, centerY + 0, 1) = 219: battleScreen(centerX - 2, centerY + 0, 2) = 15
  330.             battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 15
  331.         CASE "S"
  332.             battleScreen(centerX - 3, centerY - 4, 1) = 219: battleScreen(centerX - 3, centerY - 4, 2) = 9
  333.             battleScreen(centerX - 3, centerY - 3, 1) = 219: battleScreen(centerX - 3, centerY - 3, 2) = 9
  334.             battleScreen(centerX - 3, centerY - 2, 1) = 219: battleScreen(centerX - 3, centerY - 2, 2) = 9
  335.             battleScreen(centerX - 3, centerY - 1, 1) = 219: battleScreen(centerX - 3, centerY - 1, 2) = 9
  336.             battleScreen(centerX - 3, centerY - 0, 1) = 219: battleScreen(centerX - 3, centerY - 0, 2) = 9
  337.             battleScreen(centerX + 3, centerY - 4, 1) = 219: battleScreen(centerX + 3, centerY - 4, 2) = 9
  338.             battleScreen(centerX + 3, centerY - 3, 1) = 219: battleScreen(centerX + 3, centerY - 3, 2) = 9
  339.             battleScreen(centerX + 3, centerY - 2, 1) = 219: battleScreen(centerX + 3, centerY - 2, 2) = 9
  340.             battleScreen(centerX + 3, centerY - 1, 1) = 219: battleScreen(centerX + 3, centerY - 1, 2) = 9
  341.             battleScreen(centerX + 3, centerY - 0, 1) = 219: battleScreen(centerX + 3, centerY - 0, 2) = 9
  342.             battleScreen(centerX - 2, centerY + 0, 1) = 219: battleScreen(centerX - 2, centerY + 0, 2) = 15
  343.             battleScreen(centerX - 2, centerY + 1, 1) = 219: battleScreen(centerX - 2, centerY + 1, 2) = 15
  344.             battleScreen(centerX - 2, centerY + 2, 1) = 219: battleScreen(centerX - 2, centerY + 2, 2) = 15
  345.             battleScreen(centerX + 2, centerY + 0, 1) = 219: battleScreen(centerX + 2, centerY + 0, 2) = 15
  346.             battleScreen(centerX + 2, centerY + 1, 1) = 219: battleScreen(centerX + 2, centerY + 1, 2) = 15
  347.             battleScreen(centerX + 2, centerY + 2, 1) = 219: battleScreen(centerX + 2, centerY + 2, 2) = 15
  348.             battleScreen(centerX - 1, centerY + 1, 1) = 219: battleScreen(centerX - 1, centerY + 1, 2) = 15
  349.             battleScreen(centerX - 1, centerY + 2, 1) = 219: battleScreen(centerX - 1, centerY + 2, 2) = 15
  350.             battleScreen(centerX - 1, centerY + 3, 1) = 219: battleScreen(centerX - 1, centerY + 3, 2) = 15
  351.             battleScreen(centerX + 1, centerY + 1, 1) = 219: battleScreen(centerX + 1, centerY + 1, 2) = 15
  352.             battleScreen(centerX + 1, centerY + 2, 1) = 219: battleScreen(centerX + 1, centerY + 2, 2) = 15
  353.             battleScreen(centerX + 1, centerY + 3, 1) = 219: battleScreen(centerX + 1, centerY + 3, 2) = 15
  354.             battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 15
  355.             battleScreen(centerX + 0, centerY + 2, 1) = 219: battleScreen(centerX + 0, centerY + 2, 2) = 15
  356.             battleScreen(centerX + 0, centerY + 3, 1) = 219: battleScreen(centerX + 0, centerY + 3, 2) = 15
  357.             battleScreen(centerX + 0, centerY + 4, 1) = 219: battleScreen(centerX + 0, centerY + 4, 2) = 15
  358.         CASE "N"
  359.             battleScreen(centerX - 3, centerY + 0, 1) = 219: battleScreen(centerX - 3, centerY + 0, 2) = 9
  360.             battleScreen(centerX - 3, centerY + 1, 1) = 219: battleScreen(centerX - 3, centerY + 1, 2) = 9
  361.             battleScreen(centerX - 3, centerY + 2, 1) = 219: battleScreen(centerX - 3, centerY + 2, 2) = 9
  362.             battleScreen(centerX - 3, centerY + 3, 1) = 219: battleScreen(centerX - 3, centerY + 3, 2) = 9
  363.             battleScreen(centerX - 3, centerY + 4, 1) = 219: battleScreen(centerX - 3, centerY + 4, 2) = 9
  364.             battleScreen(centerX + 3, centerY + 0, 1) = 219: battleScreen(centerX + 3, centerY + 0, 2) = 9
  365.             battleScreen(centerX + 3, centerY + 1, 1) = 219: battleScreen(centerX + 3, centerY + 1, 2) = 9
  366.             battleScreen(centerX + 3, centerY + 2, 1) = 219: battleScreen(centerX + 3, centerY + 2, 2) = 9
  367.             battleScreen(centerX + 3, centerY + 3, 1) = 219: battleScreen(centerX + 3, centerY + 3, 2) = 9
  368.             battleScreen(centerX + 3, centerY + 4, 1) = 219: battleScreen(centerX + 3, centerY + 4, 2) = 9
  369.             battleScreen(centerX - 2, centerY - 2, 1) = 219: battleScreen(centerX - 2, centerY - 2, 2) = 15
  370.             battleScreen(centerX - 2, centerY - 1, 1) = 219: battleScreen(centerX - 2, centerY - 1, 2) = 15
  371.             battleScreen(centerX - 2, centerY - 0, 1) = 219: battleScreen(centerX - 2, centerY - 0, 2) = 15
  372.             battleScreen(centerX + 2, centerY - 2, 1) = 219: battleScreen(centerX + 2, centerY - 2, 2) = 15
  373.             battleScreen(centerX + 2, centerY - 1, 1) = 219: battleScreen(centerX + 2, centerY - 1, 2) = 15
  374.             battleScreen(centerX + 2, centerY - 0, 1) = 219: battleScreen(centerX + 2, centerY - 0, 2) = 15
  375.             battleScreen(centerX - 1, centerY - 3, 1) = 219: battleScreen(centerX - 1, centerY - 3, 2) = 15
  376.             battleScreen(centerX - 1, centerY - 2, 1) = 219: battleScreen(centerX - 1, centerY - 2, 2) = 15
  377.             battleScreen(centerX - 1, centerY - 1, 1) = 219: battleScreen(centerX - 1, centerY - 1, 2) = 15
  378.             battleScreen(centerX + 1, centerY - 3, 1) = 219: battleScreen(centerX + 1, centerY - 3, 2) = 15
  379.             battleScreen(centerX + 1, centerY - 2, 1) = 219: battleScreen(centerX + 1, centerY - 2, 2) = 15
  380.             battleScreen(centerX + 1, centerY - 1, 1) = 219: battleScreen(centerX + 1, centerY - 1, 2) = 15
  381.             battleScreen(centerX + 0, centerY - 4, 1) = 219: battleScreen(centerX + 0, centerY - 4, 2) = 15
  382.             battleScreen(centerX + 0, centerY - 3, 1) = 219: battleScreen(centerX + 0, centerY - 3, 2) = 15
  383.             battleScreen(centerX + 0, centerY - 2, 1) = 219: battleScreen(centerX + 0, centerY - 2, 2) = 15
  384.             battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 15
  385.     END SELECT
  386.  
  387. SUB EraseEspializer (centerX, centerY, orientation$)
  388.     SELECT CASE orientation$
  389.         CASE "E"
  390.             battleScreen(centerX - 4, centerY - 3, 1) = 32: battleScreen(centerX - 4, centerY - 3, 2) = 0
  391.             battleScreen(centerX - 3, centerY - 3, 1) = 32: battleScreen(centerX - 3, centerY - 3, 2) = 0
  392.             battleScreen(centerX - 2, centerY - 3, 1) = 32: battleScreen(centerX - 2, centerY - 3, 2) = 0
  393.             battleScreen(centerX - 1, centerY - 3, 1) = 32: battleScreen(centerX - 1, centerY - 3, 2) = 0
  394.             battleScreen(centerX - 0, centerY - 3, 1) = 32: battleScreen(centerX - 0, centerY - 3, 2) = 0
  395.             battleScreen(centerX - 4, centerY + 3, 1) = 32: battleScreen(centerX - 4, centerY + 3, 2) = 0
  396.             battleScreen(centerX - 3, centerY + 3, 1) = 32: battleScreen(centerX - 3, centerY + 3, 2) = 0
  397.             battleScreen(centerX - 2, centerY + 3, 1) = 32: battleScreen(centerX - 2, centerY + 3, 2) = 0
  398.             battleScreen(centerX - 1, centerY + 3, 1) = 32: battleScreen(centerX - 1, centerY + 3, 2) = 0
  399.             battleScreen(centerX - 0, centerY + 3, 1) = 32: battleScreen(centerX - 0, centerY + 3, 2) = 0
  400.             battleScreen(centerX + 0, centerY - 2, 1) = 32: battleScreen(centerX + 0, centerY - 2, 2) = 0
  401.             battleScreen(centerX + 1, centerY - 2, 1) = 32: battleScreen(centerX + 1, centerY - 2, 2) = 0
  402.             battleScreen(centerX + 2, centerY - 2, 1) = 32: battleScreen(centerX + 2, centerY - 2, 2) = 0
  403.             battleScreen(centerX + 1, centerY - 1, 1) = 32: battleScreen(centerX + 1, centerY - 1, 2) = 0
  404.             battleScreen(centerX + 2, centerY - 1, 1) = 32: battleScreen(centerX + 2, centerY - 1, 2) = 0
  405.             battleScreen(centerX + 3, centerY - 1, 1) = 32: battleScreen(centerX + 3, centerY - 1, 2) = 0
  406.             battleScreen(centerX + 1, centerY + 0, 1) = 32: battleScreen(centerX + 1, centerY + 0, 2) = 0
  407.             battleScreen(centerX + 2, centerY + 0, 1) = 32: battleScreen(centerX + 2, centerY + 0, 2) = 0
  408.             battleScreen(centerX + 3, centerY + 0, 1) = 32: battleScreen(centerX + 3, centerY + 0, 2) = 0
  409.             battleScreen(centerX + 4, centerY + 0, 1) = 32: battleScreen(centerX + 4, centerY + 0, 2) = 0
  410.             battleScreen(centerX + 1, centerY + 1, 1) = 32: battleScreen(centerX + 1, centerY + 1, 2) = 0
  411.             battleScreen(centerX + 2, centerY + 1, 1) = 32: battleScreen(centerX + 2, centerY + 1, 2) = 0
  412.             battleScreen(centerX + 3, centerY + 1, 1) = 32: battleScreen(centerX + 3, centerY + 1, 2) = 0
  413.             battleScreen(centerX + 0, centerY + 2, 1) = 32: battleScreen(centerX + 0, centerY + 2, 2) = 0
  414.             battleScreen(centerX + 1, centerY + 2, 1) = 32: battleScreen(centerX + 1, centerY + 2, 2) = 0
  415.             battleScreen(centerX + 2, centerY + 2, 1) = 32: battleScreen(centerX + 2, centerY + 2, 2) = 0
  416.         CASE "W"
  417.             battleScreen(centerX + 0, centerY - 3, 1) = 32: battleScreen(centerX + 0, centerY - 3, 2) = 0
  418.             battleScreen(centerX + 1, centerY - 3, 1) = 32: battleScreen(centerX + 1, centerY - 3, 2) = 0
  419.             battleScreen(centerX + 2, centerY - 3, 1) = 32: battleScreen(centerX + 2, centerY - 3, 2) = 0
  420.             battleScreen(centerX + 3, centerY - 3, 1) = 32: battleScreen(centerX + 3, centerY - 3, 2) = 0
  421.             battleScreen(centerX + 4, centerY - 3, 1) = 32: battleScreen(centerX + 4, centerY - 3, 2) = 0
  422.             battleScreen(centerX + 0, centerY + 3, 1) = 32: battleScreen(centerX + 0, centerY + 3, 2) = 0
  423.             battleScreen(centerX + 1, centerY + 3, 1) = 32: battleScreen(centerX + 1, centerY + 3, 2) = 0
  424.             battleScreen(centerX + 2, centerY + 3, 1) = 32: battleScreen(centerX + 2, centerY + 3, 2) = 0
  425.             battleScreen(centerX + 3, centerY + 3, 1) = 32: battleScreen(centerX + 3, centerY + 3, 2) = 0
  426.             battleScreen(centerX + 4, centerY + 3, 1) = 32: battleScreen(centerX + 4, centerY + 3, 2) = 0
  427.             battleScreen(centerX - 2, centerY - 2, 1) = 32: battleScreen(centerX - 2, centerY - 2, 2) = 0
  428.             battleScreen(centerX - 1, centerY - 2, 1) = 32: battleScreen(centerX - 1, centerY - 2, 2) = 0
  429.             battleScreen(centerX - 0, centerY - 2, 1) = 32: battleScreen(centerX - 0, centerY - 2, 2) = 0
  430.             battleScreen(centerX - 2, centerY + 2, 1) = 32: battleScreen(centerX - 2, centerY + 2, 2) = 0
  431.             battleScreen(centerX - 1, centerY + 2, 1) = 32: battleScreen(centerX - 1, centerY + 2, 2) = 0
  432.             battleScreen(centerX - 0, centerY + 2, 1) = 32: battleScreen(centerX - 0, centerY + 2, 2) = 0
  433.             battleScreen(centerX - 3, centerY - 1, 1) = 32: battleScreen(centerX - 3, centerY - 1, 2) = 0
  434.             battleScreen(centerX - 2, centerY - 1, 1) = 32: battleScreen(centerX - 2, centerY - 1, 2) = 0
  435.             battleScreen(centerX - 1, centerY - 1, 1) = 32: battleScreen(centerX - 1, centerY - 1, 2) = 0
  436.             battleScreen(centerX - 3, centerY + 1, 1) = 32: battleScreen(centerX - 3, centerY + 1, 2) = 0
  437.             battleScreen(centerX - 2, centerY + 1, 1) = 32: battleScreen(centerX - 2, centerY + 1, 2) = 0
  438.             battleScreen(centerX - 1, centerY + 1, 1) = 32: battleScreen(centerX - 1, centerY + 1, 2) = 0
  439.             battleScreen(centerX - 4, centerY + 0, 1) = 32: battleScreen(centerX - 4, centerY + 0, 2) = 0
  440.             battleScreen(centerX - 3, centerY + 0, 1) = 32: battleScreen(centerX - 3, centerY + 0, 2) = 0
  441.             battleScreen(centerX - 2, centerY + 0, 1) = 32: battleScreen(centerX - 2, centerY + 0, 2) = 0
  442.             battleScreen(centerX - 1, centerY + 0, 1) = 32: battleScreen(centerX - 1, centerY + 0, 2) = 0
  443.         CASE "S"
  444.             battleScreen(centerX - 3, centerY - 4, 1) = 32: battleScreen(centerX - 3, centerY - 4, 2) = 0
  445.             battleScreen(centerX - 3, centerY - 3, 1) = 32: battleScreen(centerX - 3, centerY - 3, 2) = 0
  446.             battleScreen(centerX - 3, centerY - 2, 1) = 32: battleScreen(centerX - 3, centerY - 2, 2) = 0
  447.             battleScreen(centerX - 3, centerY - 1, 1) = 32: battleScreen(centerX - 3, centerY - 1, 2) = 0
  448.             battleScreen(centerX - 3, centerY - 0, 1) = 32: battleScreen(centerX - 3, centerY - 0, 2) = 0
  449.             battleScreen(centerX + 3, centerY - 4, 1) = 32: battleScreen(centerX + 3, centerY - 4, 2) = 0
  450.             battleScreen(centerX + 3, centerY - 3, 1) = 32: battleScreen(centerX + 3, centerY - 3, 2) = 0
  451.             battleScreen(centerX + 3, centerY - 2, 1) = 32: battleScreen(centerX + 3, centerY - 2, 2) = 0
  452.             battleScreen(centerX + 3, centerY - 1, 1) = 32: battleScreen(centerX + 3, centerY - 1, 2) = 0
  453.             battleScreen(centerX + 3, centerY - 0, 1) = 32: battleScreen(centerX + 3, centerY - 0, 2) = 0
  454.             battleScreen(centerX - 2, centerY + 0, 1) = 32: battleScreen(centerX - 2, centerY + 0, 2) = 0
  455.             battleScreen(centerX - 2, centerY + 1, 1) = 32: battleScreen(centerX - 2, centerY + 1, 2) = 0
  456.             battleScreen(centerX - 2, centerY + 2, 1) = 32: battleScreen(centerX - 2, centerY + 2, 2) = 0
  457.             battleScreen(centerX + 2, centerY + 0, 1) = 32: battleScreen(centerX + 2, centerY + 0, 2) = 0
  458.             battleScreen(centerX + 2, centerY + 1, 1) = 32: battleScreen(centerX + 2, centerY + 1, 2) = 0
  459.             battleScreen(centerX + 2, centerY + 2, 1) = 32: battleScreen(centerX + 2, centerY + 2, 2) = 0
  460.             battleScreen(centerX - 1, centerY + 1, 1) = 32: battleScreen(centerX - 1, centerY + 1, 2) = 0
  461.             battleScreen(centerX - 1, centerY + 2, 1) = 32: battleScreen(centerX - 1, centerY + 2, 2) = 0
  462.             battleScreen(centerX - 1, centerY + 3, 1) = 32: battleScreen(centerX - 1, centerY + 3, 2) = 0
  463.             battleScreen(centerX + 1, centerY + 1, 1) = 32: battleScreen(centerX + 1, centerY + 1, 2) = 0
  464.             battleScreen(centerX + 1, centerY + 2, 1) = 32: battleScreen(centerX + 1, centerY + 2, 2) = 0
  465.             battleScreen(centerX + 1, centerY + 3, 1) = 32: battleScreen(centerX + 1, centerY + 3, 2) = 0
  466.             battleScreen(centerX + 0, centerY + 1, 1) = 32: battleScreen(centerX + 0, centerY + 1, 2) = 0
  467.             battleScreen(centerX + 0, centerY + 2, 1) = 32: battleScreen(centerX + 0, centerY + 2, 2) = 0
  468.             battleScreen(centerX + 0, centerY + 3, 1) = 32: battleScreen(centerX + 0, centerY + 3, 2) = 0
  469.             battleScreen(centerX + 0, centerY + 4, 1) = 32: battleScreen(centerX + 0, centerY + 4, 2) = 0
  470.         CASE "N"
  471.             battleScreen(centerX - 3, centerY + 0, 1) = 32: battleScreen(centerX - 3, centerY + 0, 2) = 0
  472.             battleScreen(centerX - 3, centerY + 1, 1) = 32: battleScreen(centerX - 3, centerY + 1, 2) = 0
  473.             battleScreen(centerX - 3, centerY + 2, 1) = 32: battleScreen(centerX - 3, centerY + 2, 2) = 0
  474.             battleScreen(centerX - 3, centerY + 3, 1) = 32: battleScreen(centerX - 3, centerY + 3, 2) = 0
  475.             battleScreen(centerX - 3, centerY + 4, 1) = 32: battleScreen(centerX - 3, centerY + 4, 2) = 0
  476.             battleScreen(centerX + 3, centerY + 0, 1) = 32: battleScreen(centerX + 3, centerY + 0, 2) = 0
  477.             battleScreen(centerX + 3, centerY + 1, 1) = 32: battleScreen(centerX + 3, centerY + 1, 2) = 0
  478.             battleScreen(centerX + 3, centerY + 2, 1) = 32: battleScreen(centerX + 3, centerY + 2, 2) = 0
  479.             battleScreen(centerX + 3, centerY + 3, 1) = 32: battleScreen(centerX + 3, centerY + 3, 2) = 0
  480.             battleScreen(centerX + 3, centerY + 4, 1) = 32: battleScreen(centerX + 3, centerY + 4, 2) = 0
  481.             battleScreen(centerX - 2, centerY - 2, 1) = 32: battleScreen(centerX - 2, centerY - 2, 2) = 0
  482.             battleScreen(centerX - 2, centerY - 1, 1) = 32: battleScreen(centerX - 2, centerY - 1, 2) = 0
  483.             battleScreen(centerX - 2, centerY - 0, 1) = 32: battleScreen(centerX - 2, centerY - 0, 2) = 0
  484.             battleScreen(centerX + 2, centerY - 2, 1) = 32: battleScreen(centerX + 2, centerY - 2, 2) = 0
  485.             battleScreen(centerX + 2, centerY - 1, 1) = 32: battleScreen(centerX + 2, centerY - 1, 2) = 0
  486.             battleScreen(centerX + 2, centerY - 0, 1) = 32: battleScreen(centerX + 2, centerY - 0, 2) = 0
  487.             battleScreen(centerX - 1, centerY - 3, 1) = 32: battleScreen(centerX - 1, centerY - 3, 2) = 0
  488.             battleScreen(centerX - 1, centerY - 2, 1) = 32: battleScreen(centerX - 1, centerY - 2, 2) = 0
  489.             battleScreen(centerX - 1, centerY - 1, 1) = 32: battleScreen(centerX - 1, centerY - 1, 2) = 0
  490.             battleScreen(centerX + 1, centerY - 3, 1) = 32: battleScreen(centerX + 1, centerY - 3, 2) = 0
  491.             battleScreen(centerX + 1, centerY - 2, 1) = 32: battleScreen(centerX + 1, centerY - 2, 2) = 0
  492.             battleScreen(centerX + 1, centerY - 1, 1) = 32: battleScreen(centerX + 1, centerY - 1, 2) = 0
  493.             battleScreen(centerX + 0, centerY - 4, 1) = 32: battleScreen(centerX + 0, centerY - 4, 2) = 0
  494.             battleScreen(centerX + 0, centerY - 3, 1) = 32: battleScreen(centerX + 0, centerY - 3, 2) = 0
  495.             battleScreen(centerX + 0, centerY - 2, 1) = 32: battleScreen(centerX + 0, centerY - 2, 2) = 0
  496.             battleScreen(centerX + 0, centerY - 1, 1) = 32: battleScreen(centerX + 0, centerY - 1, 2) = 0
  497.     END SELECT
  498.     CALL PrintBattleScreen

line 230 is the first line of the DrawSarien SUB that uses "battleScreen" I hate asking help to debug but the code looks fine to me.  I already eliminated For-Next loops i used in drawing the espializer. It worked but the Espializer woildn't shop up until an arrowkey was pressed. i had the same trouble with the Sarien ship so I stuffed it on the screen with a locate command. I initially used locate for all the graphics but I had just as much trouble with the code then as I am now. I made a version where the sarien is in one place and the espializer approaches it but you can't move it with the arrowkeys. anyway, please let me know if you can find an error i'm missing