You could put it in a for...next loop
sync on
distance=10
speed#=1
make object sphere 1,10
while returnkey()=0
sync
text 0,0,"Press Enter to continue"
endwhile
cls
for i=1 to distance/speed#
sync
move object 1,speed#
next i
print "The sphere moved "+str$(distance)+" units of space"
sync
wait key
or you could use an if test
sync on
currentdistance#=0
distance=10
speed#=1
make object sphere 1,10
while returnkey()=0
sync
text 0,0,"Press Enter to continue"
endwhile
cls
do
sync
if currentdistance#<distance
move object 1,speed#
inc currentdistance#,speed#
else
text 0,0,"The sphere moved "+str$(distance)+" units of space"
endif
loop
or you could use a while loop
sync on
currentdistance#=0
distance=10
speed#=1
make object sphere 1,10
while returnkey()=0
sync
text 0,0,"Press Enter to continue"
endwhile
cls
while currentdistance#<distance
sync
move object 1,speed#
inc currentdistance#,speed#
endwhile
text 0,0,"The sphere moved "+str$(distance)+" units of space"
sync
wait key
Do...Loop is usually used for when you want something to keep happening for a very long time in a program. It is usually used for the main loop of the program.
Insanity is just a state of mind