迷路ゲーム

迷路ゲームをカラー液晶用に改造してみた。
イメージ 1
参考にしたページはこちら

https://op-basic.jimdo.com/orange-basic-%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0/%E8%BF%B7%E8%B7%AF/

 
遊び方:30秒以内に方向キーで右下のゴールまで移動してください。
ゴールすれば何回でも遊べます、タイムオーバーで終了しますが何かキーを押せばまた遊べます
 
プログラムリスト
 
100 top@
110 cls
120 cltms
130 tmover=30
140 mptr 0
150 mdata &h3c,&h7e,&hff,&hff,&hff,&hff,&h7e,&h3c
160 mdata 0,0,&h18,&h3c,&h3c,&h18,0,0
170 cpeek -1,0
180 for x=0 to 38
190 locate x,0
200 print chr$(143);
210 locate x,26
220 print chr$(143);
230 next x
240 for y=0 to 26
250 locate 0,y
260 print chr$(143);
270 locate 38,y
280 print chr$(143);
290 next y
300 for y=2 to 24 step 2
310 for x=2 to 36 step 2
320 locate x,y
330 print chr$(143);
340 r=rnd(4)
350 xx=x-(r=0)+(r=1)
360 yy=y-(r=2)+(r=3)
370 locate xx,yy
380 print chr$(143);
390 next x
400 next y
410 gput 296,200,8,0,60000
420 x=1
430 y=1
440 loop1@
450 gx=x*8
460 gy=y*8
470 gput gx,gy,8,8000,62000
480 beep 10,30
490 if x=37 and y=25 goto goal@
500 keyin@
510 t=tickms()
520 t=t/1000
530 t1=tmover-t
540 gprint 0,224,"Time:",30000
550 time$=" "+str$(t1)
560 time$=right$(time$,2)
570 gprint 56,224,time$,30000
580 if t1=0 then goto gameend@
590 i=inkey()
600 xx=x-(i=28)+(i=29)
610 yy=y-(i=30)+(i=31)
620 if xx=x and yy=y goto keyin@
630 if vpeek(xx,yy)=143 goto keyin@
640 gx=x*8
650 gy=y*8
660 gput gx,gy,8,8,40000
670 x=xx
680 y=yy
690 goto loop1@
700 goal@
710 y=26
720 for x=40 to 200 step 8
730 gprint x,y,"CLEAR",rnd(65000)
740 y=y+8
750 next x
760 play "o6dgb"
770 pause 2000
780 goto top@
790 gameend@
800 y=200
810 beep 5,1000
820 for x=200 to 40 step -8
830 gprint x,y,"GAME OVER",60000
840 y=y-8
850 next x
860 loop2@
870 i=inkey()
880 if i=0 then goto loop2@
890 goto top@