I need help with the collision in my little game project( i haven't gotten past this part!

)
sync on
load music "tu.mid",1 : loop music 1
load image "map.bmp",1
make matrix 1,1500,1500,15,15
prepare matrix texture 1,1,15,15
update matrix 1
sync
if spacekey()=1 then make object sphere 3-90,3
load object "combat tank.x",1
scale object 1,50,50,50
rem Set variables for character position
x#=500
z#=500
rem Activate manual sync
sync on
rem Begin loop
do
rem Control player
if upkey()=1 then x#=newxvalue(x#,a#,5) : z#=newzvalue(z#,a#,5)
if downkey()=1 then x#=newxvalue(x#,a#,-5) : z#=newzvalue(z#,a#,-5)
if leftkey()=1 then a#=wrapvalue(a#-5)
if rightkey()=1 then a#=wrapvalue(a#+5)
rem Update character
y#=get ground height(1,x#,z#)+0.0
position object 1,x#,y#,z#
yrotate object 1,a#
rem Position camera
cx#=newxvalue(x#,wrapvalue(a#+200),200)
cz#=newzvalue(z#,wrapvalue(a#+200),200)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
rem Point camera at object
point camera x#,y#,z#
rem Syncronise
sync
oldx#=x#
oldz#=z#
oldangle#=angle#
load object "cube.x",2
position object 2,50,0,70
scale object 2,30,30,30
set object collision on 1
position object 1,x#,0,z#
rotate object 1,0,angle#,0
if object hit(1,0)>0
ink 0,rgb(255,0,0)
endif
if object collision(1,0)>0
x#=oldx#
z#=oldz#
angle#=oldangle#
endif
rem End loop
loop
set object collision off 1
I Will Host Your game at my site!!!