100 init 110 campos 1,200,-100,-600 120 bgcol 0,30,50 130 score=0 140 miss=0 150 size=400 160 sx=0 170 ex=size 180 sz=size 190 ez=-size 200 getspos x1,y1,z1,1,sx,0,sz 210 getspos x2,y2,z2,1,ex,0,sz 220 getspos x3,y3,z3,1,sx,0,ez 230 getspos x4,y4,z4,1,ex,0,ez 240 linepos 1,x1,y1,x2,y2,0 250 linepos 2,x2,y2,x4,y4,0 260 linepos 3,x1,y1,x3,y3,0 270 linepos 4,x3,y3,x4,y4,0 280 linepos 5,x1,y1,x1,0,0 290 linepos 6,x2,y2,x2,0,0 300 for i=1 to 6 310 linecol i,100,100,100,128 320 linedisp i 330 next i 340 rg=80 350 mx=200 360 my=-20 370 mz=0 380 md=pi 390 modset 1,8,1 400 modpos 1,mx,my,mz 410 modrot 1,0,md,0 420 modopt 2,0.25,1,0,1 430 moddisp 1 440 br=5 450 bx=100 460 by=-100 470 bz=-300 480 bvx=2.4 490 bvy=-1.5 500 bvz=5.4 510 modset 2,1,9 520 modpos 2,bx,by,bz 530 moddisp 2 540 call setshadow 550 tilecol 1,0,0,0,128 560 tiledisp 1 570 rem ####################### main 580 label main 590 call ballmove 600 call padmove 610 locate 0,0 620 print "SCORE:";score 630 print " MISS:";miss 640 if miss>=3 then end 650 fsync 1 660 goto *main 670 rem ################### pad-move 680 sub padmove 690 xx=pad(1,14)-127 700 zz=-pad(1,13)+127 710 x0=mx 720 z0=mz 730 if abs(xx)>20 then 740 mx=mx+xx/15 750 if mx<0 then mx=0 760 if mx>ex then mx=ex 770 end if 780 if abs(zz)>20 then 790 mz=mz+zz/15 800 if mz>sz then mz=sz 810 if mz0 or dz<>0 then 860 modpos 1,mx,my,mz 870 if dx=0 then 880 if dz<0 then md=0 else md=pi 890 elseif dz=0 then 900 if dx<0 then md=pi/2 else md=pi*1.5 910 else 920 md=atn(dx/dz) 930 if dz>0 then md=md+pi 940 end if 950 modrot 1,0,md,0 960 end if 970 a1=pad(1,6) 980 if a1>20 and a0<=20 then 990 dd=sqr((mx-bx)^2+(my-by)^2+(mz-bz)^2) 1000 if dd<=rg then 1010 if bvz<0 then 1020 bvz=-1.02*bvz 1030 seplay 34,100,100 1040 score=score+10 1050 end if 1060 end if 1070 end if 1080 end sub 1090 rem ################## ball-move 1100 sub ballmove 1110 bx=bx+bvx 1120 by=by+bvy 1130 bz=bz+bvz 1140 if bxex-br then 1190 seplay 37,100,100 1200 bx=bx-bvx 1210 bvx=-bvx 1220 end if 1230 if bz>sz-br then 1240 seplay 37,100,100 1250 bz=bz-bvz 1260 bvz=-bvz 1270 elseif bz-br then 1340 seplay 37,100,100 1350 by=by-bvy 1360 bvy=-bvy 1370 end if 1380 bvy=bvy+0.05 1390 modpos 2,bx,by,bz 1400 call setshadow 1410 end sub 1420 rem ##################### shadow 1430 sub setshadow 1440 getspos x1,y1,z1,1,bx-br,-br/2,bz 1450 getspos x2,y2,z2,1,bx+br,br/2,bz 1460 tilepos 1,x1,y1,x2,y2,z1+0.01 1470 end sub