So I was on step 3 making my character move but there seems to be a invisible wall blocking me off that is separate from the collision I made. Any idea why?
code:
--map code
function map_setup()
--map tile settings
wall=0
key=1
door=2
ania1=3
ania2=4
lose=6
win=7
end
function draw_map()
mapx=mid(0,p.x-8,111)
mapy=mid(0,p.y-8,47)
camera(mapx*8,mapy*8)
map(0,0,0,0,128,64)
end
function is_tile(tile_type,x,y)
tile=mget(x,y)
has_flag=fget(tile,tile_type)
return has_flag
end
function can_move(x,y)
return not is_tile(wall,x,y)
end
--player code
function make_player()
p={}
p.y=5
p.x=3
p.sprite=1
p.keys=0
end
function draw_player()
spr(p.sprite,p.x*8,p.y*8)
end
function move_player()
newx=p.x
newy=p.y
if (btnp(⬅️)) newx-=1
if (btnp(➡️)) newx+=1
if (btnp(⬆️)) newy-=1
if (btnp(⬇️)) newy+=1
if (can_move(newx,newy)) then
p.x=mid(0,mewx,128)
p.y=mid(0,newy,64)
else
sfx(0)
end
end