*推箱子 ************************************************** ***----------推箱子------------------------*** ***-------转发请尊重作者劳动成果---------------*** PROCEDURE commandgroup1.init thisformmandgroup1.buttoncount=105 thisformmandgroup1.top=50 thisformmandgroup1.left=25 thisformmandgroup1.width=300 thisformmandgroup1.height=300 FOR i=1 TO 10&;&;行 FOR j=1 TO 10&;&;列 p="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".caption" w="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".width" h="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".height" a="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".top" b="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".left" c="thisformmandgroup1mand"+ALLTRIM(STR((i-1)*10+j))+".backcolor" &;p="" &;w=30 &;h=30 &;a=(i-1)*30 &;b=(j-1)*30 &;c=RGB(0,0,0) endfor ENDFOR FOR i=101 TO 105 a="thisformmandgroup1mand"+ALLTRIM(STR(i))+".top" w="thisformmandgroup1mand"+ALLTRIM(STR(i))+".width" h="thisformmandgroup1mand"+ALLTRIM(STR(i))+".height" &;a=-100 &;w=30 &;h=30 endfor ENDPROC PROCEDURE keypress LPARAMETERS nKeyCode, nShiftAltCtrl n=0 t=0 DO CASE *-----------------------下方向的
CASE nkeycode=24 FOR k=101 TO 104 e="thisformmandgroup1mand"+ALLTRIM(STR(k))+".top" f="thisformmandgroup1mand"+ALLTRIM(STR(k))+".left" IF &;e=thisformmandgroup1mand105.top+30 AND &;f=thisformmandgroup1mand105.left n=n+1 exit ENDIF ENDFOR FOR k=101 TO 104 e="thisformmandgroup1mand"+ALLTRIM(STR(k))+".top" f="thisformmandgroup1mand"+ALLTRIM(STR(k))+".left" IF n=1 IF &;e=thisformmandgroup1mand105.top+60 &;f=thisformmandgroup1mand105.left t=t+1 ENDIF endif ENDFOR IF t=0 FOR i=1 TO 90 a="thisformmandgroup1mand"+ALLTRIM(STR(i))+".top" b="thisformmandgroup1mand"+ALLTRIM(STR(i))+".left" IF n=1 c="thisformmandgroup1mand"+ALLTRIM(STR(i+10))+".backcolor" ELSE c="thisformmandgroup1mand"+ALLTRIM(STR(i))+".backcolor" endif IF thisformmandgroup1mand105.top=&;a-30 thisformmandgroup1mand105.left=&;b AND &;c=RGB(255,255,255) FOR i=101 TO 104 e="thisformmandgroup1mand"+ALLTRIM(STR(i))+".top" f="thisformmandgroup1mand"+ALLTRIM(STR(i))+".left" IF &;e=thisformmandgroup1mand105.top+30 &;f=thisformmandgroup1mand105.left &;e=&;e+30 endif ENDFOR thisformmandgroup1mand105.top=thisformmandgroup1mand105.top+30 ENDIF ENDFOR endif
AND
AND
AND
*-----------------------左方向的 CASE nkeycode=19 FOR k=101 TO 104 e="thisformmandgroup1mand"+ALLTRIM(STR(k))+".top" f="thisformmandgroup1mand"+ALLTRIM(STR(k))+".left" IF &;e=thisformmandgroup1mand105.top AND &;f=thisformmandgroup1mand105.left-30 n=n+1 exit ENDIF ENDFOR FOR k=101 TO 104 e="thisformmandgroup1mand"+ALLTRIM(STR(k))+".top" f="thisformmandgroup1mand"+ALLTRIM(STR(k))+".left" IF n=1 IF &;e=thisformmandgroup1ma
nd105.top AND &;f=thisformmandgroup1mand105.left-60 t=t+1 ENDIF endif ENDFOR IF t=0 FOR i=2 TO 100 a="thisformmandgroup1mand"+ALLTRIM(STR(i))+".top" b="thisformmandgroup1mand"+ALLTRIM(STR(i))+".left" IF n=1 c="thisformmandgroup1mand"+ALLTRIM(STR(i-1))+".ba