I took your code and turned it into a dumb little game..
yeah!! Im a noob!
`matrix collision testing
`system settings
sync on
sync rate 100
hide mouse
set global collision on
plr_scr=0
`matrixs sizes
matx = 100
matz = 100
`matrix and object construction and positioning
make matrix 1,matx,matz,10,10
update matrix 1
make object sphere 1,5
make object box 2,2.5,2.5,2.5
color object 1,rgb(255,0,0)
color object 2,rgb(0,255,0)
position object 1,5,get ground height (1,matx,matz),5
position object 2,rnd(matx),get ground height (1,matx,matz),rnd(matz)
`the main loop
do
`posting score on screen
set cursor 1,1:print "Your Score Is ";plr_scr
`old object positions
oldx# = object position x(1)
oldz# = object position z(1)
`positioning of the camera
position camera 0,0,20,-20
point camera 0,object position x(1),-10,object position z(1)
`controling the object with the arrowkeys
if upkey() then move object 1,0.75
if downkey() then move object 1,-0.75
if leftkey() then move object left 1,0.75
if rightkey() then move object right 1,0.75
`detecting collision
if object position x(1) >= matx then position object 1,oldx#,0,oldz#
if object position z(1) >= matz then position object 1,oldx#,0,oldz#
if object position x(1) <= 2 then position object 1,oldx#,0,oldz#
if object position z(1) <= 2 then position object 1,oldx#,0,oldz#
if object collision (1,2) then gosub score
`updating the screen
sync
`starting all over again :)
loop
`getting points
score:
plr_scr=plr_scr+1
`moving the target
position object 2,rnd(matx),get ground height (1,matx,matz),rnd(matz)
return