Hello my problem is that when I use the for next loop a message appear telling me that the object is not found
here is my code
REM Project: 3d modeller
REM Created: 1/24/2009 10:49:19 PM
REM
REM ***** Main Source File *****
REM
sync on
sync rate 0
hide mouse
set display mode 800,600,32
autocam off
backdrop on
color backdrop rgb(0,100,255)
set camera range 1,100000
load image "ground.jpg",1
make object box 1,20,20,40
color object 1,rgb(0,255,0)
set object collision on 1
fix object pivot 1
set object specular 1,0
position object 1,0,0,0
set object collision on 1
for o=5 to 15
make object sphere o,10
position object o,rnd(10000),0,rnd(10000)
color object o,rgb(0,255,0)
next o
set object collision on o
make matrix 1,100000,100000,100,100
randomize matrix 1,rnd(500)
position matrix 1,0,0,0
prepare matrix texture 1,1,10,10
update matrix 1
if object collision (1,o) then scale object 1,object size x(1),object size y(1),object size z(1)+10
do
center text screen width()/2,10,"This is a game made by Mahmoud"
center text screen width()/2,30,"Use the arrowkeys to move "
center text screen width()/2,50,"Press controlkey and arrowkeys to increase speed"
moveplayer()
followplayer()
collisionwithground()
sync
loop
function moveplayer()
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+3)
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-3)
if upkey()=1 then move object 1,3
if downkey()=1 then move object 1,-3
if controlkey()=1 and upkey()=1 then move object 1,6
if controlkey()=1 and downkey()=1 then move object 1,-6
endfunction
function followplayer()
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
a#=object angle y(1)
d#=250.0
h#=80.0
s#=50.0
set camera to follow x#,y#,z#,a#,d#,h#,s#,1
endfunction
function collisionwithground)
ox#=object position x(1)
oz#=object position z(1)
oy#=(object size y(1)/2) + get ground height(1,ox#,oz#)
position object 1,ox#,oy#,oz#
endfunction
thanks
