lets take a look and see whats right and wrong.
Quote: "
sync rate 20
sync on
"
the actual rate you have chosen is probably too slow for a 3d application.
usually 30 or 60 is chosen for smoother looking animations.
Quote: "
make object cube 1,100
"
you have made a cube at 100 units, and relying on Darkbasic to use the auto camera pointing to visualize the object, your also relying on darkbasic to place it at world center 0,0,0
Quote: "
do
hide object 1
if mouseclick()>0
show object 1
sync
loop
"
you have created in infinte loop that will never end.
within this loop every cycle your using the hide command.
this means even if it is hidden your asking it to be hidden again.
your using an if statement without an endif tag thats essential for use together
your using a operator to say if mouseclick is greater then zero where as you could use a simpler operator to say if mouseclick = 1 : perform action ; endif
closing your loop and adding sync at the end is correct however when you terminate your program or want to restart your game there is no clean up.
a good loop breaker is the while endwhile command tags used in unison
sync on : sync rate 60
make object cube 1,100
position object 1,0,0,0
rem place the camera 50 up and 50 backwards from 0,0,0
position camera 0,50,-50
point camera 0,0,0
disable escapekey : while escapekey()=0
if mouseclick()=1
show object 1
else
hide object 1
endif
sync : endwhile
delete object 1
end
and then when you press escape it will escape from the loop, delete your object and end your program.
clearly a bad example that wouldnt run due to the endif error.
time to learn some more before posting stuff your not focusing on.
however dont let that stop you from learning new commands, just make sure your focusing on what your doing.