Because CenterX is 0 when you run the program, and your array is only dimmed for a low value of 1.
WIDTH 80, 50
_FULLSCREEN
CONST shotDelay = 0.03
CONST fireBeep = "L64O3CEGAA"
CONST shipHitBeep = "L64O1EEEEEL16CC"
DIM SHARED battleScreen(1 TO 80, 1 TO 45, 1 TO 2)
FOR fillY = 1 TO 45
FOR fillX = 1 TO 80
battleScreen(fillX, fillY, 1) = 32
battleScreen(fillX, fillY, 2) = 0
NEXT fillX
NEXT fillY
RANDOMIZE TIMER
COLOR 0, 0
CLS
LOCATE 1, 1
CALL Battle
FUNCTION locateToBegin () STATIC
starting = starting + 1
locateToBegin = starting
END FUNCTION
SUB PrintBattleScreen ()
CLS: LOCATE 1, 1
FOR printY = 1 TO 45
FOR printX = 1 TO 80
IF printX <> 80 THEN
COLOR battleScreen(printX, printY, 2), 0
PRINT CHR$(battleScreen(printX, printY, 1));
ELSE
COLOR battleScreen(printX, printY, 2), 0
PRINT CHR$(battleScreen(printX, printY, 1))
END IF
NEXT printX
NEXT printY
END SUB
SUB RelocateSarien
espializerLeft = 80
espializerRight = 1
espializerTop = 45
espializerBottomn = 1
'there's gotta be an easier way to find the square radius of the espializer
'all i can thing of is many different FOR-NEXT loops
'any way is better than no way. so be it
'find the top
FOR scanningX = 1 TO 80
FOR scanningY = 1 TO 45
IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
espializerTop = scanningY
EXIT FOR
END IF
NEXT scanningY
NEXT scanningX
'find the bottom
FOR scanningX = 1 TO 80
FOR scanningY = 45 TO 1 STEP -1
IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
espializerBottom = scanningY
EXIT FOR
END IF
NEXT scanningY
NEXT scanningX
'find left
FOR scanningX = 1 TO 80
FOR scanningY = 1 TO 45
IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
espializerLeft = scanningX
EXIT FOR
END IF
NEXT scanningY
NEXT scanningX
'find right
FOR scanningX = 80 TO 1 STEP -1
FOR scanningY = 1 TO 45
IF battleScreen(scanningX, scanningY, 2) = 15 OR battleScreen(scanningX, scanningY, 2) = 9 THEN
espializerRight = scanningX
EXIT FOR
END IF
NEXT scanningY
NEXT scanningX
'ok, now that i have the square radius, make sure the new coordinates won't be inside a 15 square radius
' but they also need to be in the line of fire
getNewSarienPlace:
rndX = INT(RND * 76) + 2
rndY = INT(RND * 42) + 2
rndOrient = INT(RND * 4) + 1
IF rndOrient = 1 THEN sarienOrientation$ = "N"
IF rndOrient = 2 THEN sarienOrientation$ = "S"
IF rndOrient = 3 THEN sarienOrientation$ = "W"
IF rndOrient = 4 THEN sarienOrientation$ = "E"
' 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
IF espializerLeft - 15 < rndX AND rndX < espializerRight + 15 AND espializerTop - 15 < rndY AND rndY < espializerBottom + 15 THEN
'need new coordinates
GOTO getNewSarienPlace
END IF
CALL DrawSarien(rndX, rndY, "S") 'sarienOrientation$) ' may not need "CALL" but like my game, i'm old school like that
END SUB
SUB Battle
'randNum% = INT(RND * (max% - min% + 1)) + min%
xPos = INT(RND * 71) + 5
yPos = INT(RND * 41) + 5
intFacing = INT(RND * 4) + 1:
IF intFacing = 1 THEN
facing$ = "N"
ELSEIF intFacing = 2 THEN
facing$ = "S"
ELSEIF intFacing = 3 THEN
facing$ = "W"
ELSEIF intFacing = 4 THEN
facing$ = "E"
END IF
' CALL DrawEspializer(xPos, yPos, facing$)
' xPos2 = INT(RND * 71) + 5
' yPos2 = INT(RND * 41) + 5
' 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"
CALL RelocateSarien
CALL PrintBattleScreen
CALL DrawSarien(xPos2, yPos2, "N")
DO
whichMove$ = INKEY$
limX = 0: limY = 0
' CALL PrintBattleScreen
SELECT CASE whichMove$
CASE CHR$(0) + "H" ' up
IF yPos > 5 THEN
IF yPos < 16 THEN
limY = 1
ELSE
limY = yPos - 15
END IF
moveFlag = 1
FOR testingX = xPos - 3 TO xPos + 3
IF battleScreen(testingX, limY, 1) <> 32 THEN moveFlag = 0
NEXT testingX
IF moveFlag = 1 THEN ' needs xPos + / - 3
CALL EraseEspializer(xPos, yPos, facing$)
yPos = yPos - 1: facing$ = "N"
CALL DrawEspializer(xPos, yPos, facing$)
CALL PrintBattleScreen
END IF
END IF
CASE CHR$(0) + "K" ' left
IF xPos > 5 THEN
IF xPos < 16 THEN
limX = 1
ELSE
limX = xPos - 15
END IF
moveFlag = 1
FOR testingY = yPos - 3 TO yPos + 3
IF battleScreen(limX, testingY, 1) <> 32 THEN moveFlag = 0
NEXT testingY
IF moveFlag = 1 THEN
CALL EraseEspializer(xPos, yPos, facing$)
xPos = xPos - 1: facing$ = "W"
CALL DrawEspializer(xPos, yPos, facing$)
CALL PrintBattleScreen
END IF
END IF
CASE CHR$(0) + "P" ' down
IF yPos < 40 THEN
IF yPos > 30 THEN
limY = 45
ELSE
limY = yPos + 15
END IF
moveFlag = 1
FOR testingX = xPos - 3 TO xPos + 3
IF battleScreen(testingX, limY, 1) <> 32 THEN moveFlag = 0
NEXT testingX
IF moveFlag = 1 THEN
CALL EraseEspializer(xPos, yPos, facing$)
yPos = yPos + 1: facing$ = "S"
CALL DrawEspializer(xPos, yPos, facing$)
CALL PrintBattleScreen
END IF
END IF
CASE CHR$(0) + "M" ' right
IF xPos < 75 THEN
IF xPos > 65 THEN
limX = 80
ELSE
limX = xPos + 15
END IF
moveFlag = 1
FOR testingY = yPos - 3 TO yPos + 3
IF battleScreen(limX, testingY, 1) <> 32 THEN moveFlag = 0
NEXT testingY
IF battleScreen(limX, yPos, 1) = 32 THEN
CALL EraseEspializer(xPos, yPos, facing$)
xPos = xPos + 1: facing$ = "E"
CALL DrawEspializer(xPos, yPos, facing$)
CALL PrintBattleScreen
END IF
END IF
CASE CHR$(27)
END
END SELECT
LOOP UNTIL whichMove$ = CHR$(27)
END SUB
SUB DrawSarien (centerX, centerY, orientation$)
COLOR 10, 0
SELECT CASE orientation$
CASE "N"
IF locateToBegin = 1 THEN
LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
LOCATE centerY - 1, centerX + 0: PRINT CHR$(219)
END IF
PRINT centerX - 1
_DISPLAY
battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
CASE "S"
IF locateToBegin = 1 THEN
LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
LOCATE centerY + 1, centerX + 0: PRINT CHR$(219)
END IF
battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
CASE "W"
IF locateToBegin = 1 THEN
LOCATE centerY + 0, centerX - 1: PRINT CHR$(219)
LOCATE centerY - 1, centerX + 0: PRINT CHR$(219)
LOCATE centerY + 1, centerX + 0: PRINT CHR$(219)
END IF
battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 10
battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
CASE "E"
IF locateToBegin = 1 THEN
LOCATE centerY + 0, centerX + 1: PRINT CHR$(219)
LOCATE centerY - 1, centerX - 1: PRINT CHR$(219)
LOCATE centerY + 1, centerX - 1: PRINT CHR$(219)
END IF
battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 10
battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 10
battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 10
END SELECT
END SUB
SUB EraseSerian (centerx, centery, orientation$)
SELECT CASE orientation$
CASE "N"
battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
battleScreen(centerx + 0, centery - 1, 1) = 32: battleScreen(centerx + 0, centery - 1, 2) = 0
CASE "S"
battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
battleScreen(centerx + 0, centery + 1, 1) = 32: battleScreen(centerx + 0, centery + 1, 2) = 0
CASE "W"
battleScreen(centerx - 1, centery + 0, 1) = 32: battleScreen(centerx - 1, centery + 0, 2) = 0
battleScreen(centerx + 1, centery - 1, 1) = 32: battleScreen(centerx + 1, centery - 1, 2) = 0
battleScreen(centerx + 1, centery + 1, 1) = 32: battleScreen(centerx + 1, centery + 1, 2) = 0
CASE "E"
battleScreen(centerx + 1, centery + 0, 1) = 32: battleScreen(centerx + 1, centery + 0, 2) = 0
battleScreen(centerx - 1, centery - 1, 1) = 32: battleScreen(centerx - 1, centery - 1, 2) = 0
battleScreen(centerx - 1, centery + 1, 1) = 32: battleScreen(centerx - 1, centery + 1, 2) = 0
END SELECT
END SUB
SUB DrawEspializer (centerX, centerY, orientation$)
SELECT CASE orientation$
CASE "E"
battleScreen(centerX - 4, centerY - 3, 1) = 219: battleScreen(centerX - 4, centerY - 3, 2) = 9
battleScreen(centerX - 3, centerY - 3, 1) = 219: battleScreen(centerX - 3, centerY - 3, 2) = 9
battleScreen(centerX - 2, centerY - 3, 1) = 219: battleScreen(centerX - 2, centerY - 3, 2) = 9
battleScreen(centerX - 1, centerY - 3, 1) = 219: battleScreen(centerX - 1, centerY - 3, 2) = 9
battleScreen(centerX - 0, centerY - 3, 1) = 219: battleScreen(centerX - 0, centerY - 3, 2) = 9
battleScreen(centerX - 4, centerY + 3, 1) = 219: battleScreen(centerX - 4, centerY + 3, 2) = 9
battleScreen(centerX - 3, centerY + 3, 1) = 219: battleScreen(centerX - 3, centerY + 3, 2) = 9
battleScreen(centerX - 2, centerY + 3, 1) = 219: battleScreen(centerX - 2, centerY + 3, 2) = 9
battleScreen(centerX - 1, centerY + 3, 1) = 219: battleScreen(centerX - 1, centerY + 3, 2) = 9
battleScreen(centerX - 0, centerY + 3, 1) = 219: battleScreen(centerX - 0, centerY + 3, 2) = 9
battleScreen(centerX + 0, centerY - 2, 1) = 219: battleScreen(centerX + 0, centerY - 2, 2) = 15
battleScreen(centerX + 1, centerY - 2, 1) = 219: battleScreen(centerX + 1, centerY - 2, 2) = 15
battleScreen(centerX + 2, centerY - 2, 1) = 219: battleScreen(centerX + 2, centerY - 2, 2) = 15
battleScreen(centerX + 1, centerY - 1, 1) = 219: battleScreen(centerX + 1, centerY - 1, 2) = 15
battleScreen(centerX + 2, centerY - 1, 1) = 219: battleScreen(centerX + 2, centerY - 1, 2) = 15
battleScreen(centerX + 3, centerY - 1, 1) = 219: battleScreen(centerX + 3, centerY - 1, 2) = 15
battleScreen(centerX + 1, centerY + 0, 1) = 219: battleScreen(centerX + 1, centerY + 0, 2) = 15
battleScreen(centerX + 2, centerY + 0, 1) = 219: battleScreen(centerX + 2, centerY + 0, 2) = 15
battleScreen(centerX + 3, centerY + 0, 1) = 219: battleScreen(centerX + 3, centerY + 0, 2) = 15
battleScreen(centerX + 4, centerY + 0, 1) = 219: battleScreen(centerX + 4, centerY + 0, 2) = 15
battleScreen(centerX + 1, centerY + 1, 1) = 219: battleScreen(centerX + 1, centerY + 1, 2) = 15
battleScreen(centerX + 2, centerY + 1, 1) = 219: battleScreen(centerX + 2, centerY + 1, 2) = 15
battleScreen(centerX + 3, centerY + 1, 1) = 219: battleScreen(centerX + 3, centerY + 1, 2) = 15
battleScreen(centerX + 0, centerY + 2, 1) = 219: battleScreen(centerX + 0, centerY + 2, 2) = 15
battleScreen(centerX + 1, centerY + 2, 1) = 219: battleScreen(centerX + 1, centerY + 2, 2) = 15
battleScreen(centerX + 2, centerY + 2, 1) = 219: battleScreen(centerX + 2, centerY + 2, 2) = 15
CASE "W"
battleScreen(centerX + 0, centerY - 3, 1) = 219: battleScreen(centerX + 0, centerY - 3, 2) = 9
battleScreen(centerX + 1, centerY - 3, 1) = 219: battleScreen(centerX + 1, centerY - 3, 2) = 9
battleScreen(centerX + 2, centerY - 3, 1) = 219: battleScreen(centerX + 2, centerY - 3, 2) = 9
battleScreen(centerX + 3, centerY - 3, 1) = 219: battleScreen(centerX + 3, centerY - 3, 2) = 9
battleScreen(centerX + 4, centerY - 3, 1) = 219: battleScreen(centerX + 4, centerY - 3, 2) = 9
battleScreen(centerX + 0, centerY + 3, 1) = 219: battleScreen(centerX + 0, centerY + 3, 2) = 9
battleScreen(centerX + 1, centerY + 3, 1) = 219: battleScreen(centerX + 1, centerY + 3, 2) = 9
battleScreen(centerX + 2, centerY + 3, 1) = 219: battleScreen(centerX + 2, centerY + 3, 2) = 9
battleScreen(centerX + 3, centerY + 3, 1) = 219: battleScreen(centerX + 3, centerY + 3, 2) = 9
battleScreen(centerX + 4, centerY + 3, 1) = 219: battleScreen(centerX + 4, centerY + 3, 2) = 9
battleScreen(centerX - 2, centerY - 2, 1) = 219: battleScreen(centerX - 2, centerY - 2, 2) = 15
battleScreen(centerX - 1, centerY - 2, 1) = 219: battleScreen(centerX - 1, centerY - 2, 2) = 15
battleScreen(centerX - 0, centerY - 2, 1) = 219: battleScreen(centerX - 0, centerY - 2, 2) = 15
battleScreen(centerX - 2, centerY + 2, 1) = 219: battleScreen(centerX - 2, centerY + 2, 2) = 15
battleScreen(centerX - 1, centerY + 2, 1) = 219: battleScreen(centerX - 1, centerY + 2, 2) = 15
battleScreen(centerX - 0, centerY + 2, 1) = 219: battleScreen(centerX - 0, centerY + 2, 2) = 15
battleScreen(centerX - 3, centerY - 1, 1) = 219: battleScreen(centerX - 3, centerY - 1, 2) = 15
battleScreen(centerX - 2, centerY - 1, 1) = 219: battleScreen(centerX - 2, centerY - 1, 2) = 15
battleScreen(centerX - 1, centerY - 1, 1) = 219: battleScreen(centerX - 1, centerY - 1, 2) = 15
battleScreen(centerX - 3, centerY + 1, 1) = 219: battleScreen(centerX - 3, centerY + 1, 2) = 15
battleScreen(centerX - 2, centerY + 1, 1) = 219: battleScreen(centerX - 2, centerY + 1, 2) = 15
battleScreen(centerX - 1, centerY + 1, 1) = 219: battleScreen(centerX - 1, centerY + 1, 2) = 15
battleScreen(centerX - 4, centerY + 0, 1) = 219: battleScreen(centerX - 4, centerY + 0, 2) = 15
battleScreen(centerX - 3, centerY + 0, 1) = 219: battleScreen(centerX - 3, centerY + 0, 2) = 15
battleScreen(centerX - 2, centerY + 0, 1) = 219: battleScreen(centerX - 2, centerY + 0, 2) = 15
battleScreen(centerX - 1, centerY + 0, 1) = 219: battleScreen(centerX - 1, centerY + 0, 2) = 15
CASE "S"
battleScreen(centerX - 3, centerY - 4, 1) = 219: battleScreen(centerX - 3, centerY - 4, 2) = 9
battleScreen(centerX - 3, centerY - 3, 1) = 219: battleScreen(centerX - 3, centerY - 3, 2) = 9
battleScreen(centerX - 3, centerY - 2, 1) = 219: battleScreen(centerX - 3, centerY - 2, 2) = 9
battleScreen(centerX - 3, centerY - 1, 1) = 219: battleScreen(centerX - 3, centerY - 1, 2) = 9
battleScreen(centerX - 3, centerY - 0, 1) = 219: battleScreen(centerX - 3, centerY - 0, 2) = 9
battleScreen(centerX + 3, centerY - 4, 1) = 219: battleScreen(centerX + 3, centerY - 4, 2) = 9
battleScreen(centerX + 3, centerY - 3, 1) = 219: battleScreen(centerX + 3, centerY - 3, 2) = 9
battleScreen(centerX + 3, centerY - 2, 1) = 219: battleScreen(centerX + 3, centerY - 2, 2) = 9
battleScreen(centerX + 3, centerY - 1, 1) = 219: battleScreen(centerX + 3, centerY - 1, 2) = 9
battleScreen(centerX + 3, centerY - 0, 1) = 219: battleScreen(centerX + 3, centerY - 0, 2) = 9
battleScreen(centerX - 2, centerY + 0, 1) = 219: battleScreen(centerX - 2, centerY + 0, 2) = 15
battleScreen(centerX - 2, centerY + 1, 1) = 219: battleScreen(centerX - 2, centerY + 1, 2) = 15
battleScreen(centerX - 2, centerY + 2, 1) = 219: battleScreen(centerX - 2, centerY + 2, 2) = 15
battleScreen(centerX + 2, centerY + 0, 1) = 219: battleScreen(centerX + 2, centerY + 0, 2) = 15
battleScreen(centerX + 2, centerY + 1, 1) = 219: battleScreen(centerX + 2, centerY + 1, 2) = 15
battleScreen(centerX + 2, centerY + 2, 1) = 219: battleScreen(centerX + 2, centerY + 2, 2) = 15
battleScreen(centerX - 1, centerY + 1, 1) = 219: battleScreen(centerX - 1, centerY + 1, 2) = 15
battleScreen(centerX - 1, centerY + 2, 1) = 219: battleScreen(centerX - 1, centerY + 2, 2) = 15
battleScreen(centerX - 1, centerY + 3, 1) = 219: battleScreen(centerX - 1, centerY + 3, 2) = 15
battleScreen(centerX + 1, centerY + 1, 1) = 219: battleScreen(centerX + 1, centerY + 1, 2) = 15
battleScreen(centerX + 1, centerY + 2, 1) = 219: battleScreen(centerX + 1, centerY + 2, 2) = 15
battleScreen(centerX + 1, centerY + 3, 1) = 219: battleScreen(centerX + 1, centerY + 3, 2) = 15
battleScreen(centerX + 0, centerY + 1, 1) = 219: battleScreen(centerX + 0, centerY + 1, 2) = 15
battleScreen(centerX + 0, centerY + 2, 1) = 219: battleScreen(centerX + 0, centerY + 2, 2) = 15
battleScreen(centerX + 0, centerY + 3, 1) = 219: battleScreen(centerX + 0, centerY + 3, 2) = 15
battleScreen(centerX + 0, centerY + 4, 1) = 219: battleScreen(centerX + 0, centerY + 4, 2) = 15
CASE "N"
battleScreen(centerX - 3, centerY + 0, 1) = 219: battleScreen(centerX - 3, centerY + 0, 2) = 9
battleScreen(centerX - 3, centerY + 1, 1) = 219: battleScreen(centerX - 3, centerY + 1, 2) = 9
battleScreen(centerX - 3, centerY + 2, 1) = 219: battleScreen(centerX - 3, centerY + 2, 2) = 9
battleScreen(centerX - 3, centerY + 3, 1) = 219: battleScreen(centerX - 3, centerY + 3, 2) = 9
battleScreen(centerX - 3, centerY + 4, 1) = 219: battleScreen(centerX - 3, centerY + 4, 2) = 9
battleScreen(centerX + 3, centerY + 0, 1) = 219: battleScreen(centerX + 3, centerY + 0, 2) = 9
battleScreen(centerX + 3, centerY + 1, 1) = 219: battleScreen(centerX + 3, centerY + 1, 2) = 9
battleScreen(centerX + 3, centerY + 2, 1) = 219: battleScreen(centerX + 3, centerY + 2, 2) = 9
battleScreen(centerX + 3, centerY + 3, 1) = 219: battleScreen(centerX + 3, centerY + 3, 2) = 9
battleScreen(centerX + 3, centerY + 4, 1) = 219: battleScreen(centerX + 3, centerY + 4, 2) = 9
battleScreen(centerX - 2, centerY - 2, 1) = 219: battleScreen(centerX - 2, centerY - 2, 2) = 15
battleScreen(centerX - 2, centerY - 1, 1) = 219: battleScreen(centerX - 2, centerY - 1, 2) = 15
battleScreen(centerX - 2, centerY - 0, 1) = 219: battleScreen(centerX - 2, centerY - 0, 2) = 15
battleScreen(centerX + 2, centerY - 2, 1) = 219: battleScreen(centerX + 2, centerY - 2, 2) = 15
battleScreen(centerX + 2, centerY - 1, 1) = 219: battleScreen(centerX + 2, centerY - 1, 2) = 15
battleScreen(centerX + 2, centerY - 0, 1) = 219: battleScreen(centerX + 2, centerY - 0, 2) = 15
battleScreen(centerX - 1, centerY - 3, 1) = 219: battleScreen(centerX - 1, centerY - 3, 2) = 15
battleScreen(centerX - 1, centerY - 2, 1) = 219: battleScreen(centerX - 1, centerY - 2, 2) = 15
battleScreen(centerX - 1, centerY - 1, 1) = 219: battleScreen(centerX - 1, centerY - 1, 2) = 15
battleScreen(centerX + 1, centerY - 3, 1) = 219: battleScreen(centerX + 1, centerY - 3, 2) = 15
battleScreen(centerX + 1, centerY - 2, 1) = 219: battleScreen(centerX + 1, centerY - 2, 2) = 15
battleScreen(centerX + 1, centerY - 1, 1) = 219: battleScreen(centerX + 1, centerY - 1, 2) = 15
battleScreen(centerX + 0, centerY - 4, 1) = 219: battleScreen(centerX + 0, centerY - 4, 2) = 15
battleScreen(centerX + 0, centerY - 3, 1) = 219: battleScreen(centerX + 0, centerY - 3, 2) = 15
battleScreen(centerX + 0, centerY - 2, 1) = 219: battleScreen(centerX + 0, centerY - 2, 2) = 15
battleScreen(centerX + 0, centerY - 1, 1) = 219: battleScreen(centerX + 0, centerY - 1, 2) = 15
END SELECT
END SUB
SUB EraseEspializer (centerX, centerY, orientation$)
SELECT CASE orientation$
CASE "E"
battleScreen(centerX - 4, centerY - 3, 1) = 32: battleScreen(centerX - 4, centerY - 3, 2) = 0
battleScreen(centerX - 3, centerY - 3, 1) = 32: battleScreen(centerX - 3, centerY - 3, 2) = 0
battleScreen(centerX - 2, centerY - 3, 1) = 32: battleScreen(centerX - 2, centerY - 3, 2) = 0
battleScreen(centerX - 1, centerY - 3, 1) = 32: battleScreen(centerX - 1, centerY - 3, 2) = 0
battleScreen(centerX - 0, centerY - 3, 1) = 32: battleScreen(centerX - 0, centerY - 3, 2) = 0
battleScreen(centerX - 4, centerY + 3, 1) = 32: battleScreen(centerX - 4, centerY + 3, 2) = 0
battleScreen(centerX - 3, centerY + 3, 1) = 32: battleScreen(centerX - 3, centerY + 3, 2) = 0
battleScreen(centerX - 2, centerY + 3, 1) = 32: battleScreen(centerX - 2, centerY + 3, 2) = 0
battleScreen(centerX - 1, centerY + 3, 1) = 32: battleScreen(centerX - 1, centerY + 3, 2) = 0
battleScreen(centerX - 0, centerY + 3, 1) = 32: battleScreen(centerX - 0, centerY + 3, 2) = 0
battleScreen(centerX + 0, centerY - 2, 1) = 32: battleScreen(centerX + 0, centerY - 2, 2) = 0
battleScreen(centerX + 1, centerY - 2, 1) = 32: battleScreen(centerX + 1, centerY - 2, 2) = 0
battleScreen(centerX + 2, centerY - 2, 1) = 32: battleScreen(centerX + 2, centerY - 2, 2) = 0
battleScreen(centerX + 1, centerY - 1, 1) = 32: battleScreen(centerX + 1, centerY - 1, 2) = 0
battleScreen(centerX + 2, centerY - 1, 1) = 32: battleScreen(centerX + 2, centerY - 1, 2) = 0
battleScreen(centerX + 3, centerY - 1, 1) = 32: battleScreen(centerX + 3, centerY - 1, 2) = 0
battleScreen(centerX + 1, centerY + 0, 1) = 32: battleScreen(centerX + 1, centerY + 0, 2) = 0
battleScreen(centerX + 2, centerY + 0, 1) = 32: battleScreen(centerX + 2, centerY + 0, 2) = 0
battleScreen(centerX + 3, centerY + 0, 1) = 32: battleScreen(centerX + 3, centerY + 0, 2) = 0
battleScreen(centerX + 4, centerY + 0, 1) = 32: battleScreen(centerX + 4, centerY + 0, 2) = 0
battleScreen(centerX + 1, centerY + 1, 1) = 32: battleScreen(centerX + 1, centerY + 1, 2) = 0
battleScreen(centerX + 2, centerY + 1, 1) = 32: battleScreen(centerX + 2, centerY + 1, 2) = 0
battleScreen(centerX + 3, centerY + 1, 1) = 32: battleScreen(centerX + 3, centerY + 1, 2) = 0
battleScreen(centerX + 0, centerY + 2, 1) = 32: battleScreen(centerX + 0, centerY + 2, 2) = 0
battleScreen(centerX + 1, centerY + 2, 1) = 32: battleScreen(centerX + 1, centerY + 2, 2) = 0
battleScreen(centerX + 2, centerY + 2, 1) = 32: battleScreen(centerX + 2, centerY + 2, 2) = 0
CASE "W"
battleScreen(centerX + 0, centerY - 3, 1) = 32: battleScreen(centerX + 0, centerY - 3, 2) = 0
battleScreen(centerX + 1, centerY - 3, 1) = 32: battleScreen(centerX + 1, centerY - 3, 2) = 0
battleScreen(centerX + 2, centerY - 3, 1) = 32: battleScreen(centerX + 2, centerY - 3, 2) = 0
battleScreen(centerX + 3, centerY - 3, 1) = 32: battleScreen(centerX + 3, centerY - 3, 2) = 0
battleScreen(centerX + 4, centerY - 3, 1) = 32: battleScreen(centerX + 4, centerY - 3, 2) = 0
battleScreen(centerX + 0, centerY + 3, 1) = 32: battleScreen(centerX + 0, centerY + 3, 2) = 0
battleScreen(centerX + 1, centerY + 3, 1) = 32: battleScreen(centerX + 1, centerY + 3, 2) = 0
battleScreen(centerX + 2, centerY + 3, 1) = 32: battleScreen(centerX + 2, centerY + 3, 2) = 0
battleScreen(centerX + 3, centerY + 3, 1) = 32: battleScreen(centerX + 3, centerY + 3, 2) = 0
battleScreen(centerX + 4, centerY + 3, 1) = 32: battleScreen(centerX + 4, centerY + 3, 2) = 0
battleScreen(centerX - 2, centerY - 2, 1) = 32: battleScreen(centerX - 2, centerY - 2, 2) = 0
battleScreen(centerX - 1, centerY - 2, 1) = 32: battleScreen(centerX - 1, centerY - 2, 2) = 0
battleScreen(centerX - 0, centerY - 2, 1) = 32: battleScreen(centerX - 0, centerY - 2, 2) = 0
battleScreen(centerX - 2, centerY + 2, 1) = 32: battleScreen(centerX - 2, centerY + 2, 2) = 0
battleScreen(centerX - 1, centerY + 2, 1) = 32: battleScreen(centerX - 1, centerY + 2, 2) = 0
battleScreen(centerX - 0, centerY + 2, 1) = 32: battleScreen(centerX - 0, centerY + 2, 2) = 0
battleScreen(centerX - 3, centerY - 1, 1) = 32: battleScreen(centerX - 3, centerY - 1, 2) = 0
battleScreen(centerX - 2, centerY - 1, 1) = 32: battleScreen(centerX - 2, centerY - 1, 2) = 0
battleScreen(centerX - 1, centerY - 1, 1) = 32: battleScreen(centerX - 1, centerY - 1, 2) = 0
battleScreen(centerX - 3, centerY + 1, 1) = 32: battleScreen(centerX - 3, centerY + 1, 2) = 0
battleScreen(centerX - 2, centerY + 1, 1) = 32: battleScreen(centerX - 2, centerY + 1, 2) = 0
battleScreen(centerX - 1, centerY + 1, 1) = 32: battleScreen(centerX - 1, centerY + 1, 2) = 0
battleScreen(centerX - 4, centerY + 0, 1) = 32: battleScreen(centerX - 4, centerY + 0, 2) = 0
battleScreen(centerX - 3, centerY + 0, 1) = 32: battleScreen(centerX - 3, centerY + 0, 2) = 0
battleScreen(centerX - 2, centerY + 0, 1) = 32: battleScreen(centerX - 2, centerY + 0, 2) = 0
battleScreen(centerX - 1, centerY + 0, 1) = 32: battleScreen(centerX - 1, centerY + 0, 2) = 0
CASE "S"
battleScreen(centerX - 3, centerY - 4, 1) = 32: battleScreen(centerX - 3, centerY - 4, 2) = 0
battleScreen(centerX - 3, centerY - 3, 1) = 32: battleScreen(centerX - 3, centerY - 3, 2) = 0
battleScreen(centerX - 3, centerY - 2, 1) = 32: battleScreen(centerX - 3, centerY - 2, 2) = 0
battleScreen(centerX - 3, centerY - 1, 1) = 32: battleScreen(centerX - 3, centerY - 1, 2) = 0
battleScreen(centerX - 3, centerY - 0, 1) = 32: battleScreen(centerX - 3, centerY - 0, 2) = 0
battleScreen(centerX + 3, centerY - 4, 1) = 32: battleScreen(centerX + 3, centerY - 4, 2) = 0
battleScreen(centerX + 3, centerY - 3, 1) = 32: battleScreen(centerX + 3, centerY - 3, 2) = 0
battleScreen(centerX + 3, centerY - 2, 1) = 32: battleScreen(centerX + 3, centerY - 2, 2) = 0
battleScreen(centerX + 3, centerY - 1, 1) = 32: battleScreen(centerX + 3, centerY - 1, 2) = 0
battleScreen(centerX + 3, centerY - 0, 1) = 32: battleScreen(centerX + 3, centerY - 0, 2) = 0
battleScreen(centerX - 2, centerY + 0, 1) = 32: battleScreen(centerX - 2, centerY + 0, 2) = 0
battleScreen(centerX - 2, centerY + 1, 1) = 32: battleScreen(centerX - 2, centerY + 1, 2) = 0
battleScreen(centerX - 2, centerY + 2, 1) = 32: battleScreen(centerX - 2, centerY + 2, 2) = 0
battleScreen(centerX + 2, centerY + 0, 1) = 32: battleScreen(centerX + 2, centerY + 0, 2) = 0
battleScreen(centerX + 2, centerY + 1, 1) = 32: battleScreen(centerX + 2, centerY + 1, 2) = 0
battleScreen(centerX + 2, centerY + 2, 1) = 32: battleScreen(centerX + 2, centerY + 2, 2) = 0
battleScreen(centerX - 1, centerY + 1, 1) = 32: battleScreen(centerX - 1, centerY + 1, 2) = 0
battleScreen(centerX - 1, centerY + 2, 1) = 32: battleScreen(centerX - 1, centerY + 2, 2) = 0
battleScreen(centerX - 1, centerY + 3, 1) = 32: battleScreen(centerX - 1, centerY + 3, 2) = 0
battleScreen(centerX + 1, centerY + 1, 1) = 32: battleScreen(centerX + 1, centerY + 1, 2) = 0
battleScreen(centerX + 1, centerY + 2, 1) = 32: battleScreen(centerX + 1, centerY + 2, 2) = 0
battleScreen(centerX + 1, centerY + 3, 1) = 32: battleScreen(centerX + 1, centerY + 3, 2) = 0
battleScreen(centerX + 0, centerY + 1, 1) = 32: battleScreen(centerX + 0, centerY + 1, 2) = 0
battleScreen(centerX + 0, centerY + 2, 1) = 32: battleScreen(centerX + 0, centerY + 2, 2) = 0
battleScreen(centerX + 0, centerY + 3, 1) = 32: battleScreen(centerX + 0, centerY + 3, 2) = 0
battleScreen(centerX + 0, centerY + 4, 1) = 32: battleScreen(centerX + 0, centerY + 4, 2) = 0
CASE "N"
battleScreen(centerX - 3, centerY + 0, 1) = 32: battleScreen(centerX - 3, centerY + 0, 2) = 0
battleScreen(centerX - 3, centerY + 1, 1) = 32: battleScreen(centerX - 3, centerY + 1, 2) = 0
battleScreen(centerX - 3, centerY + 2, 1) = 32: battleScreen(centerX - 3, centerY + 2, 2) = 0
battleScreen(centerX - 3, centerY + 3, 1) = 32: battleScreen(centerX - 3, centerY + 3, 2) = 0
battleScreen(centerX - 3, centerY + 4, 1) = 32: battleScreen(centerX - 3, centerY + 4, 2) = 0
battleScreen(centerX + 3, centerY + 0, 1) = 32: battleScreen(centerX + 3, centerY + 0, 2) = 0
battleScreen(centerX + 3, centerY + 1, 1) = 32: battleScreen(centerX + 3, centerY + 1, 2) = 0
battleScreen(centerX + 3, centerY + 2, 1) = 32: battleScreen(centerX + 3, centerY + 2, 2) = 0
battleScreen(centerX + 3, centerY + 3, 1) = 32: battleScreen(centerX + 3, centerY + 3, 2) = 0
battleScreen(centerX + 3, centerY + 4, 1) = 32: battleScreen(centerX + 3, centerY + 4, 2) = 0
battleScreen(centerX - 2, centerY - 2, 1) = 32: battleScreen(centerX - 2, centerY - 2, 2) = 0
battleScreen(centerX - 2, centerY - 1, 1) = 32: battleScreen(centerX - 2, centerY - 1, 2) = 0
battleScreen(centerX - 2, centerY - 0, 1) = 32: battleScreen(centerX - 2, centerY - 0, 2) = 0
battleScreen(centerX + 2, centerY - 2, 1) = 32: battleScreen(centerX + 2, centerY - 2, 2) = 0
battleScreen(centerX + 2, centerY - 1, 1) = 32: battleScreen(centerX + 2, centerY - 1, 2) = 0
battleScreen(centerX + 2, centerY - 0, 1) = 32: battleScreen(centerX + 2, centerY - 0, 2) = 0
battleScreen(centerX - 1, centerY - 3, 1) = 32: battleScreen(centerX - 1, centerY - 3, 2) = 0
battleScreen(centerX - 1, centerY - 2, 1) = 32: battleScreen(centerX - 1, centerY - 2, 2) = 0
battleScreen(centerX - 1, centerY - 1, 1) = 32: battleScreen(centerX - 1, centerY - 1, 2) = 0
battleScreen(centerX + 1, centerY - 3, 1) = 32: battleScreen(centerX + 1, centerY - 3, 2) = 0
battleScreen(centerX + 1, centerY - 2, 1) = 32: battleScreen(centerX + 1, centerY - 2, 2) = 0
battleScreen(centerX + 1, centerY - 1, 1) = 32: battleScreen(centerX + 1, centerY - 1, 2) = 0
battleScreen(centerX + 0, centerY - 4, 1) = 32: battleScreen(centerX + 0, centerY - 4, 2) = 0
battleScreen(centerX + 0, centerY - 3, 1) = 32: battleScreen(centerX + 0, centerY - 3, 2) = 0
battleScreen(centerX + 0, centerY - 2, 1) = 32: battleScreen(centerX + 0, centerY - 2, 2) = 0
battleScreen(centerX + 0, centerY - 1, 1) = 32: battleScreen(centerX + 0, centerY - 1, 2) = 0
END SELECT
CALL PrintBattleScreen
END SUB
Easy solution to this is just to make the array large enough to handle the negative indexes:
DIM SHARED battleScreen(-5 TO 85, -5 TO 50, 1 TO 2)