set display mode 1024,768,32
sync on : sync rate 60
make matrix 1,1000,1000,50,50
make object box 1,5,10,5 : position object 1,500,5,500
position camera 500,10,480
sphere=100
do
sh#=screen height()/2
my#=mousey()
an#=0.234375
angley#=((sh#/2 - my#)*an#)+135
control camera using arrowkeys 0,2,3
rotate object 1,angley#,0,0
if mouseclick()=1
make object sphere sphere,1 : position object sphere,5,10,5
move object sphere,5
sphere=sphere+1
endif
sync
loop
the concerning part
if mouseclick()=1
make object sphere sphere,1 : position object sphere,5,10,5
move object sphere,5
sphere=sphere+1
endif
when running this it is fine the object rotates well, when i click mouse, the concerning section of the code, it is meant to create a sphere and send it in a direction, but (there is always but) when i do it, it sends the camera to what i think is 0,0,0 on the matrix and i dont get to see my sphere
will someone please help on why this happens and how to fix it