Here you go, i don't want to explain everthing I did, let's just say i had to redesign the seeker logic.
'Gapper(1986) Clone
'10\25\2019 Cobalt
' ÀInitial Start; Layout, Gapper, Seeker, L1 Grid finished [13:55EDT]
' ÀCorrected 'Catcher' to 'Seeker' as per original game
TYPE GameData
Player AS STRING * 4
Score AS LONG
Lives AS _BYTE
Level AS _BYTE
GX AS INTEGER
GY AS INTEGER
GD AS _BYTE 'Gapper direction
SX AS INTEGER
SY AS INTEGER
SS AS _BYTE 'Seeker speed
SD AS _BYTE 'Seeker direction
Start AS _BYTE 'is level started or not(nothing happens until started)
FPS AS INTEGER
END TYPE
CONST TRUE = -1, FALSE = NOT TRUE, Gapper = 1, Seeker = 2
CONST UP = 1, DOWN = 2, LEFT = 3, RIGHT = 4
CONST Key_Right = 19712, Key_Left = 19200, Key_Up = 18432, Key_Down = 20480
CONST Key_Space = 32, Key_Enter = 13
CONST Cyan = &HFF10E0E0~& '_RGB32(0, 170, 170)
CONST Magenta = &HFFC040C0~&
CONST OffWhite = &HFFC0C0C0~&
CONST Brown = &HFFB06000~&
SCREEN _NEWIMAGE(640, 440, 32)
DIM SHARED Layer(10) AS _UNSIGNED LONG, G AS GameData, Frames%
Layer(0) = _DISPLAY
Layer(1) = _NEWIMAGE(640, 440, 32) 'mix layer
Layer(2) = _NEWIMAGE(320, 220, 32) 'Grid Layer
Layer(3) = _NEWIMAGE(640, 440, 32) 'Sprite layer
Layer(4) = _NEWIMAGE(320, 220, 32) 'Info layer
Layer(5) = _NEWIMAGE(640, 440, 32) 'Collision 'Gapper\Catcher' layer
Layer(6) = _NEWIMAGE(640, 440, 32) 'Collision 'Grid' layer
Layer(7) = _NEWIMAGE(640, 440, 32) 'debug layer
_FONT 8, Layer(4)
_CLEARCOLOR _RGB32(0, 0, 0), Layer(3)
_CLEARCOLOR _RGB32(0, 0, 0), Layer(7)
_PRINTMODE _KEEPBACKGROUND , Layer(4)
_SCREENMOVE 16, 16
_SOURCE Layer(6)
ON TIMER(t1&, 1) gFPS
Game_INIT
DrawBoard
TIMER(t1&) ON
DO
IF _KEYDOWN(27) THEN ExitFlag%% = TRUE
IF _KEYDOWN(Key_Up) THEN
G.Start = TRUE
IF NOT Collision_Grid(Gapper, UP) THEN G.GD = UP
END IF
IF _KEYDOWN(Key_Down) THEN
G.Start = TRUE
IF NOT Collision_Grid(Gapper, DOWN) THEN G.GD = DOWN
END IF
IF _KEYDOWN(Key_Left) THEN
G.Start = TRUE
IF NOT Collision_Grid(Gapper, LEFT) THEN G.GD = LEFT
END IF
IF _KEYDOWN(Key_Right) THEN
G.Start = TRUE
IF NOT Collision_Grid(Gapper, RIGHT) THEN G.GD = RIGHT
END IF
IF G.Start THEN Move_Seeker: Move_Gapper
Game_Data_Update
_PUTIMAGE , Layer(4), Layer(1)
_PUTIMAGE , Layer(2), Layer(1)
Place_Gapper
Place_Seeker
_PRINTSTRING (600, 0), STR$(G.FPS), Layer(7)
_PUTIMAGE , Layer(7), Layer(1)
_PUTIMAGE , Layer(1), Layer(0)
_LIMIT 60
ClearLayer Layer(1)
Frames% = Frames% + 1
LOOP UNTIL ExitFlag%%
CLS
_PUTIMAGE , Layer(6), Layer(0)
SUB Place_Gapper
'place gapper-----
_PUTIMAGE (G.GX, G.GY), Layer(3), Layer(1), (318, 218)-STEP(15, 13)
END SUB
SUB Place_Seeker
'place Seeker----
_PUTIMAGE (G.SX, G.SY), Layer(3), Layer(1), (341, 218)-STEP(14, 11)
'-----------------
END SUB
SUB Game_INIT
_DEST Layer(3)
'Player----
DRAW "c" + STR$(Cyan) + "drurd8l2dr3u9d2rd5ru5rd5ru5ru2d9r3ul2u8r2dlbl3c" + STR$(Magenta) + "u3ld3lu3ld3"
DRAW "bd7d3ru3rd3ru3bu3br3r4ul4bl9l4dr4"
'----------
DRAW "br20bu7"
'Seeker----
DRAW "c" + STR$(Cyan) + "r3dl3bd10r3ul3br10r3dl3bu10r3ul3c" + STR$(Magenta) + "bd2brl3dr3bd5l3dr3bl6l3ur3"
DRAW "bu5l3ur3d2lr5dl5dr5dl5"
'------------
'Header
_DEST Layer(4)
LINE (84, 0)-STEP(151, 8), Magenta, BF
LINE (132, 0)-STEP(52, 8), Cyan, BF
COLOR Magenta
_PRINTSTRING (135, 1), "GAPPER"
COLOR OffWhite
_DEST Layer(0)
G.Score = 0
G.Lives = 2
G.Level = 1
'Level 1 Start Pos.------
G.GX = 0: G.GY = 14 'Gapper
G.SX = 626: G.SY = 374 'Seeker
'------------------------
END SUB
SUB Game_Data_Update
'Info area updating ---------------
_PRINTSTRING (7, 192), "Score[ ] Lives[ ] Level[ ]", Layer(4)
_PRINTSTRING (95 - ((LEN(LTRIM$(STR$(G.Score))) - 1) * 8), 192), LTRIM$(STR$(G.Score)), Layer(4)
_PRINTSTRING (191, 192), LTRIM$(STR$(G.Lives)), Layer(4)
_PRINTSTRING (295 - ((LEN(LTRIM$(STR$(G.Level))) - 1) * 8), 192), LTRIM$(STR$(G.Level)), Layer(4)
'-----------------------------------
END SUB
SUB DrawBoard
_DEST Layer(2)
SELECT CASE G.Level
CASE 1 'draw level 1 grid
FOR I%% = 0 TO 3
LINE (4, 10 + I%% * 60)-STEP(311, 0), Cyan 'horizontal lines
LINE (4 + I%% * 104, 10)-STEP(0, 180), Cyan 'vertical lines
NEXT I%%
G.SS = 1 'set seeker speed 1\4th player speed
G.Start = FALSE
END SELECT
_DEST Layer(0)
ClearLayer Layer(6)
_PUTIMAGE , Layer(2), Layer(6) 'make a copy for the collision layer
END SUB
SUB ClearLayer (L&)
_DEST L&
CLS
_DEST _DISPLAY
END SUB
FUNCTION Collision_Grid%% (who%%, Direction%%)
Result%% = TRUE 'always assume collision
' _SOURCE Layer(6)
SELECT CASE who%% 'who are we checking collision for?
CASE Gapper
SELECT CASE Direction%%
CASE UP 'see if there is grid up from Gappers position
Check~& = POINT(G.GX + 8, G.GY + 5)
CASE DOWN 'see if there is Grid below Gapper
Check~& = POINT(G.GX + 8, G.GY + 9)
CASE LEFT 'check for grid to the left of Gapper
Check~& = POINT(G.GX + 6, G.GY + 7)
CASE RIGHT 'Check for grid to the Right of Gapper
Check~& = POINT(G.GX + 10, G.GY + 7)
END SELECT
CASE Seeker
SELECT CASE Direction%%
CASE UP 'see if there is grid up from Gappers position
Check~& = POINT(G.SX + 8, G.SY + 5)
CASE DOWN 'see if there is Grid below Gapper
Check~& = POINT(G.SX + 8, G.SY + 9)
CASE LEFT 'check for grid to the left of Gapper
Check~& = POINT(G.SX + 6, G.SY + 7)
CASE RIGHT 'Check for grid to the Right of Gapper
Check~& = POINT(G.SX + 10, G.SY + 7)
END SELECT
END SELECT
Blue~%% = _BLUE32(Check~&) 'check for Blue, grid is Cyan in color
IF Blue~%% THEN Result%% = FALSE 'there is grid to move onto, no collision with edge of grid
Collision_Grid = Result%%
'_SOURCE Layer(0)
END FUNCTION
SUB Move_Seeker
STATIC Mover%%
Seeker_Logic
IF Mover%% < G.SS THEN
Mover%% = Mover%% + 1
ELSE
Mover%% = 0
SELECT CASE G.SD
CASE UP
IF NOT Collision_Grid(Seeker, UP) THEN G.SY = G.SY - 2
CASE DOWN
IF NOT Collision_Grid(Seeker, DOWN) THEN G.SY = G.SY + 2
CASE LEFT
IF NOT Collision_Grid(Seeker, LEFT) THEN G.SX = G.SX - 2
CASE RIGHT
IF NOT Collision_Grid(Seeker, RIGHT) THEN G.SX = G.SX + 2
END SELECT
END IF
_PRINTSTRING (10, 410), STR$(Mover%%) + STR$(G.SD) + STR$(G.SX - G.GX) + STR$(G.SY - G.GY), Layer(7)
END SUB
SUB Move_Gapper
SELECT CASE G.GD
CASE UP
IF NOT Collision_Grid(Gapper, UP) THEN G.GY = G.GY - 2
CASE DOWN
IF NOT Collision_Grid(Gapper, DOWN) THEN G.GY = G.GY + 2
CASE LEFT
IF NOT Collision_Grid(Gapper, LEFT) THEN G.GX = G.GX - 2
CASE RIGHT
IF NOT Collision_Grid(Gapper, RIGHT) THEN G.GX = G.GX + 2
END SELECT
Color_Line
END SUB
SUB Seeker_Logic
IF G.SX > G.GX THEN
DistX% = (G.SX - G.GX) 'find X distance between seeker and gapper
ELSE
DistX% = (G.GX - G.SX) 'find X distance between seeker and gapper
END IF
IF G.SY > G.GY THEN
DistY% = (G.SY - G.GY) 'find Y distance between seeker and gapper
ELSE
DistY% = (G.GY - G.SY) 'find Y distance between seeker and gapper
END IF
IF DistX% > DistY% THEN 'if player is farther on the X then
IF G.SX > G.GX THEN
Turn_Seeker LEFT
ELSE
Turn_Seeker RIGHT
END IF
ELSE 'player is farther on the Y then
IF G.SY > G.GY THEN
Turn_Seeker UP
ELSE
Turn_Seeker DOWN
END IF
END IF
END SUB
SUB Turn_Seeker (Direction%%)
SELECT CASE Direction%%
CASE UP
IF NOT Collision_Grid(Seeker, UP) THEN G.SD = UP
CASE DOWN
IF NOT Collision_Grid(Seeker, DOWN) THEN G.SD = DOWN
CASE LEFT
IF NOT Collision_Grid(Seeker, LEFT) THEN G.SD = LEFT
CASE RIGHT
IF NOT Collision_Grid(Seeker, RIGHT) THEN G.SD = RIGHT
END SELECT
END SUB
SUB Color_Line
_DEST Layer(2)
LINE (4 + G.GX \ 2, 3 + G.GY \ 2)-STEP(0, 0), Magenta, BF
_DEST Layer(0)
END SUB
SUB gFPS
G.FPS = Frames%
Frames% = 0
END SUB