Here's a basic example of how the collision would work:
rem make a floor
make matrix 1,1000,1000,50,50
rem make a ball
make object sphere 1,25
position object 1,500,25,500
color object 1,rgb(0,255,0)
rem make a cube to hit the ball
make object cube 2,50
position object 2,600,25,500
color object 2,rgb(255,0,0)
rem set collision
set object collision to spheres 1
set object collision to boxes 2
rem position camera
position camera 500,25,300
rem move object cube
while hit < 1
position object 2,object position x(2)-1,object position y(2),object position z(2)
hit=object collision(2,0) : rem return object number of collision with cube
endwhile
rem ball is hit
do
position object hit,object position x(1)-1,object position y(1),object position z(1)
loop
Enjoy your day.