Quote: "P.S. I love your Subroutines marker i think i'm gunna copy that with your permission haha "
Sure, go ahead!
I updated my example using your tip:
rem setup screen
sync on
sync rate 60
backdrop on
color backdrop 0
hide mouse
rem create everything
gosub _init
rem main loop
do
rem position camera at sphere
set camera to follow x#,y#,z#,ay#,50,y#+10,10,0
point camera x#,y#+5,z#
rem get X and Z sphere positions
x#=object position x(1)
z#=object position z(1)
ay#=object angle y(1)
rem rotate sphere
if leftkey()=1 then ay#=wrapvalue(ay#-2)
if rightkey()=1 then ay#=wrapvalue(ay#+2)
rem left, right, up, down
if keystate(17)=1 then x#=newxvalue(x#,ay#,2):z#=newzvalue(z#,ay#,2)
if keystate(31)=1 then x#=newxvalue(x#,wrapvalue(ay#+180),2):z#=newzvalue(z#,wrapvalue(ay#+180),2)
if keystate(30)=1 then x#=newxvalue(x#,wrapvalue(ay#+270),2):z#=newzvalue(z#,wrapvalue(ay#+270),2)
if keystate(32)=1 then x#=newxvalue(x#,wrapvalue(ay#+90),2):z#=newzvalue(z#,wrapvalue(ay#+90),2)
rem get ground height for sphere
y#=get ground height(1,x#,z#)+5
rem update sphere positions
position object 1,x#,y#,z#
yrotate object 1,ay#
rem refresh screen
sync
rem end of main loop
loop
rem end
end
rem #####--#---#--####---####----###---#---#--#####--#####--#---#--#####--#####--
rem #------#---#--#---#--#---#--#---#--#---#----#------#----##--#--#------#------
rem #####--#---#--####---####---#---#--#---#----#------#----#-#-#--#####--#####--
rem ----#--#---#--#---#--#-#----#---#--#---#----#------#----#--##--#----------#--
rem #####---###---####---#--#----###----###-----#----#####--#---#--#####--#####--
_init:
rem make a texture
create bitmap 1,128,128
ink rgb(255,255,255),0
box 0,0,127,127
ink rgb(255,0,0),0
circle 32,40,10
circle 96,40,10
line 30,80,98,80
get image 1,0,0,128,128
delete bitmap 1
rem create a sphere and texture it
make object sphere 1,10
position object 1,0,0,0
texture object 1,1
rem make a matrix
make matrix 1,1000,1000,20,20
randomize matrix 1,20
return
Use left and right arrow keys to rotate, use a,d,s,w to move sideways, forwards or backwards.
TheComet
Peachy, and the Chaos of the Gems
