Recoded some stuff, added subroutines, fixed some glaring errors, all thanks to Z!re. I know theres more, it'll come with time.
Code:
DECLARE SUB movement (x%, y%)
DECLARE SUB redrawmap (checkformovex%, checkformovey%, x%, y%)
DIM SHARED map(32, 20)
DIM SHARED pacman(10, 10)
DIM SHARED charmask(10, 10)
DIM SHARED blank(10, 10)
DIM SHARED WallLR(10, 10)
DIM SHARED wallUD(10, 10)
DIM SHARED cornerUL(10, 10)
DIM SHARED cornerUR(10, 10)
DIM SHARED cornerDL(10, 10)
DIM SHARED cornerDR(10, 10)
DIM SHARED x AS INTEGER
DIM SHARED y AS INTEGER
DIM SHARED checkformovex AS INTEGER
DIM SHARED checkformovey AS INTEGER
SCREEN 13
GOSUB testgraph
x = 2
y = 2
CLS
top:
WAIT &H3DA, 8
movement x%, y%
redrawmap checkformovex%, checkformovey%, x%, y%
GOTO top
'=========================================================================
testgraph:
'create Blank tile
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), blank
'create Left2Right Bar tile
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), WallLR
'create Top2Bottom Bar tile
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), wallUD
'create Corner Upper Left
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), cornerUL
'create Corner Upper Right
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), cornerUR
'create Corner Lower Left
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), cornerDL
'create Corner Lower Right
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), cornerDR
'create face
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), pacman
'create mask
FOR y = 1 TO 10
FOR x = 1 TO 10
READ colr
PSET (x, y), colr
NEXT x
NEXT y
GET (1, 1)-(10, 10), charmask
CLS
FOR y = 0 TO 19
FOR x = 0 TO 31
READ map
map(x, y) = map
NEXT: NEXT
FOR mapx = 0 TO 32 - 1
FOR mapy = 0 TO 20 - 1
SELECT CASE map(mapx, mapy)
CASE 0
PUT (mapx * 10, mapy * 10), blank, PSET
CASE 1
PUT (mapx * 10, mapy * 10), WallLR, PSET
CASE 2
PUT (mapx * 10, mapy * 10), wallUD, PSET
CASE 3
PUT (mapx * 10, mapy * 10), cornerUL, PSET
CASE 4
PUT (mapx * 10, mapy * 10), cornerUR, PSET
CASE 5
PUT (mapx * 10, mapy * 10), cornerDL, PSET
CASE 6
PUT (mapx * 10, mapy * 10), cornerDR, PSET
CASE ELSE
END SELECT
NEXT: NEXT
CLS
RETURN
'===========================================================================
'Blank
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
'wall Left2Right(along the top and bottom)
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 01,01,01,01,01,01,01,01,01,01
DATA 01,01,01,01,01,01,01,01,01,01
DATA 01,01,01,01,01,01,01,01,01,01
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
'wall Top2bottom(along left and right sides)
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
'corner Upper Left
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
'Corner Upper Right
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
'corner Lower Left
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,01,01,01,01,01,01,01
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
'Corner Lower Right
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 00,00,00,01,01,01,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 01,01,01,01,01,01,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
'pacman
DATA 00,00,00,14,14,14,14,00,00,00
DATA 00,00,14,14,14,14,14,14,00,00
DATA 00,14,14,14,14,14,14,14,14,00
DATA 00,14,14,14,14,14,14,14,14,00
DATA 14,14,14,14,14,14,14,14,14,14
DATA 14,14,14,14,14,14,14,14,14,14
DATA 00,14,14,14,00,00,00,00,00,00
DATA 00,14,14,14,14,00,00,00,00,00
DATA 00,00,14,14,14,14,14,14,00,00
DATA 00,00,00,14,14,14,14,00,00,00
'mask
DATA 255,255,255,000,000,000,000,255,255,255
DATA 255,255,000,000,000,000,000,000,255,255
DATA 255,000,000,000,000,000,000,000,000,255
DATA 255,000,000,000,000,000,000,000,000,255
DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,000,000,000,000,000,000,000,000
DATA 255,000,000,000,000,000,000,000,000,255
DATA 255,000,000,000,000,000,000,000,000,255
DATA 255,255,000,000,000,000,000,000,255,255
DATA 255,255,255,000,000,000,000,255,255,255
'==================================================================
'map data
DATA 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4
DATA 2,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,2
DATA 2,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,2
DATA 2,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,0,0,0,0,0,0,2
DATA 5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,6
SUB movement (x%, y%)
SELECT CASE INKEY$
CASE CHR$(0) + "H"
'up
IF map(x, y - 1) <> 2 AND (y * 10) - 10 > 1 THEN
y = y - 1
END IF
CASE CHR$(0) + "P"
'down
IF map(x, y + 1) <> 2 AND (y * 10) + 10 < 190 THEN
y = y + 1
END IF
CASE CHR$(0) + "K"
'left
IF map(x - 1, y) <> 2 AND (x * 10) - 10 > 1 THEN
x = x - 1
END IF
CASE CHR$(0) + "M"
'right
IF map(x + 1, y) <> 2 AND (x * 10) + 10 < 310 THEN
x = x + 1
END IF
CASE CHR$(27)
END
END SELECT
END SUB
SUB redrawmap (checkformovex%, checkformovey%, x%, y%)
IF checkformovex <> x OR checkformovey <> y THEN
checkformovex = x
checkformovey = y
'redraw screen
FOR mapx = 0 TO 32 - 1
FOR mapy = 0 TO 20 - 1
SELECT CASE map(mapx, mapy)
CASE 0
PUT (mapx * 10, mapy * 10), blank, PSET
CASE 1
PUT (mapx * 10, mapy * 10), WallLR, PSET
CASE 2
PUT (mapx * 10, mapy * 10), wallUD, PSET
CASE 3
PUT (mapx * 10, mapy * 10), cornerUL, PSET
CASE 4
PUT (mapx * 10, mapy * 10), cornerUR, PSET
CASE 5
PUT (mapx * 10, mapy * 10), cornerDL, PSET
CASE 6
PUT (mapx * 10, mapy * 10), cornerDR, PSET
CASE ELSE
END SELECT
NEXT: NEXT
'put character in new location
PUT (x * 10, y * 10), charmask, AND
PUT (x * 10, y * 10), pacman, OR
END IF
END SUB
I also thought I should note that the "Blank" sprite will eventually be replaced by the "pellet" sprite that I haven't made yet, but until then, I'm making it blank cause looking at about 70 pellets gets annoying.