100 init 110 k=0 120 l=100 130 dim pat(11,11) 140 xs=100 150 zs=100 160 campos 1,-100,-120,-100 170 camrot 1,pi/12,-pi/4,0 180 ambcol 150,150,150 190 for i=1 to 11 200 for j=1 to 11 210 read pat(j,i) 220 if pat(j,i)=1 then 230 k=k+1 240 modset k+20,3,5 250 modpos k+20,i*xs,-20,j*zs 260 modopt k+20,2.5,1,0,1 270 moddisp k+20 280 else 290 l=l+1 300 modset l,3,3 310 modpos l,i*xs,80,j*zs 320 modopt l,2.5,1,0,1 330 moddisp l 340 end if 350 next j 360 next i 370 tx=200 380 tz=200 390 td=pi 400 tcd=40 410 modrot 1,0,td,0 420 modset 1,7,1 430 modpos 1,tx,0,tz 440 moddisp 1 450 modset 2,4,10 460 modpos 2,5*xs,0,5*zs 470 modopt 2,3,1,0,1 480 moddisp 2 490 rem ##################### main 500 label main 510 cx=-tcd*sin(td) 520 cz=-tcd*cos(td) 530 campos 1,tx-cx,-20,tz-cz 540 camvec 1,cx,0,cz 550 px=pad(1,14)-127 560 py=pad(1,13)-127 570 if abs(px)>30 then 580 ppx=px/5000 590 td=td+ppx 600 if td<0 then td=td+pi*2 610 if td>pi*2 then td=td-pi*2 620 modrot 1,0,td,0 630 end if 640 if abs(py)>30 then 650 tkv=py/40 660 xx=tkv*sin(td) 670 zz=tkv*cos(td) 680 modpos 1,tx+xx,0,tz+zz 690 if collision(1,21,21+k)=0 then 700 tx=tx+xx 710 tz=tz+zz 720 else 730 tx=tx-xx 740 tz=tz-zz 750 modpos 1,tx,0,tz 760 end if 770 end if 780 if pad(1,20)=1 then end 790 fsync 1 9990 goto *main 10000 rem ######################## 10010 data 1,1,1,1,1,1,1,1,1,1,1 10020 data 1,0,0,0,0,0,0,0,0,0,1 10030 data 1,0,0,0,0,0,0,0,0,0,1 10040 data 1,0,0,1,0,0,0,1,0,0,1 10050 data 1,0,0,0,0,0,0,0,0,0,1 10060 data 1,0,0,0,0,0,0,0,0,0,1 10070 data 1,0,0,0,0,0,0,0,0,0,1 10080 data 1,0,0,1,0,0,0,1,0,0,1 10090 data 1,0,0,0,0,0,0,0,0,0,1 10100 data 1,0,0,0,0,0,0,0,0,0,1 10110 data 1,1,1,1,1,1,1,1,1,1,1