rem Blobs ..... rev 2.0 rem A J Tooth // February 2006 on error if (err=17) then quit *FLOAT 64 rem Go to fullscreen proc_fullscreen A=-50 : Dis=5000.0 : dT=0.05 num%=100 origin xscreen%,yscreen% gcol 3 rem Set up rocks proc_rocks a$="" *REFRESH OFF repeat cls for a%=1 to num% rem Display each rock proc_disp(rock{(a%)}) next a% *REFRESH rem Update rock position, and its velocity if it hits a wall for b%=1 to num% for i&=1 to 3 rock{(b%)}.pstn(i&)+=dT*rock{(b%)}.vel(i&) chk=rock{(b%)}.pstn(i&) if (chk<-50.0 or chk>50.0) then rock{(b%)}.vel(i&)=-rock{(b%)}.vel(i&) next i& next b% a$=inkey$(0) until a$<>"" quit end rem End of Program ========================================== rem ========================================================= rem Set up use of Full Screen def proc_fullscreen sys "GetSystemMetrics", 0 to xscreen% sys "GetSystemMetrics", 1 to yscreen% sys "SetWindowLong",@hwnd%,-16,&16000000 sys "SetWindowPos",@hwnd%,-1,0,0,xscreen%,yscreen%,0 vdu 23,22,xscreen%;yscreen%;8,16,16,1 : rem Set fullscreen mode mouse off : off : rem Turns off the Mouse Pointer and the Cursor endproc rem ------------------------------------------------------------- rem Display the point def proc_disp(rr{}) local Fac,x,y,c&,x%,y%,rs&,gs&,bs&,rdl&,X,Z,Y,f X=rr.pstn(1) : Z=rr.pstn(2) : Y=rr.pstn(3) Fac=(1-A)/((Z+Dis)-A) : rem Reduction or scale factor x=X*Fac : y=Y*Fac rem Scale to screen size x%=int(xscreen%*x) : y%=int(yscreen%*y) rdl&=1+int((50+Z)) lm&=5+int(rdl&/3) for c&=lm& to 1 step -1 f=1-c&/lm& rs&=int(rr.col&(1)*f) gs&=int(rr.col&(2)*f) bs&=int(rr.col&(3)*f) colour 10,rs&,gs&,bs& : gcol 10 @vdu%!248=1+int(2*c&*rdl&/lm&) line 2*x%,2*y%,2*x%+1,2*y%+1 next c& endproc rem =================================================================== rem Set up rocks def proc_rocks local a% dim rock{(num%)pstn(3),vel(3),col&(3)} for a%=1 to num% rem Position vector rock{(a%)}.pstn(1)=1.0*(rnd(100)-50) rock{(a%)}.pstn(2)=1.0*(rnd(100)-50) rock{(a%)}.pstn(3)=1.0*(rnd(100)-50) rem Velocity vector rock{(a%)}.vel(1)=30*rnd(1)-15.0 rock{(a%)}.vel(2)=30*rnd(1)-15.0 rock{(a%)}.vel(3)=30*rnd(1)-15.0 rem Colour hue for i&=1 to 3 rock{(a%)}.col&(i&)=50+rnd(205) next i& next a% endproc rem ===================================================================