上下の移動をボタンを押した場合のみ行いたいのですがうまくいきません
ぜひ誰かお願いします
buffer 1
boxf 0,0,40,40
screen 0,640,480
color 0,0,0
MX=80 :MY=80
*ikkai
gosub *ikkai_map
while
redraw 0
gosub *ikkai_move
gosub *ikkai_ht
redraw 1
title ""
await 100
wend
*ikkai_map
dim MAP,17,13
MAP(0,0) =1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
MAP(0,2) =1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,3) =1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,4) =1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,5) =1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1
MAP(0,6) =1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1
MAP(0,7) =1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1
MAP(0,8) =1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,9) =1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,10)=1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
MAP(0,11)=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
return
*ikkai_move
;640,480
if MX\32=0 :MDX=0
if MY\24=0 :MDY=0
stick KY,15
if KY=1 :MDX=-16
if KY=4 :MDX=16
if KY=2 :MDY=-12
if KY=8 :MDY=12
MPX0=(MX+MDX)/40 :MPX1=(MX+MDX+39)/40
MPY0=(MY+MDY)/40 :MPY1=(MY+MDY+39)/40
if MAP(MPX0,MPY0)=1 or MAP(MPX1,MPY0)=1 or MAP(MPX0,MPY1)=1 or MAP(MPX1,MPY1)=1 {
MDX=0 :MDY=0 }
MX=MX+MDX :MY=MY+MDY
return
*ikkai_ht
pos MX,MY :gcopy 1,0,0,40,40
return