The bolded part of my code shows what i have right now for moving platforms. But i know that that isn't smooth, and the platform itself just stays in one spot, and doesn't move. I have tried almost all day to fix this, but i can't! Any help?
do
texture object 100,1
for a = 1 to 9
if object exist(a+100)
texture object a+100,2
endif
next a
for b = 96 to 99
if object exist(b)
texture object b,3
endif
next b
texture object 1,4
if object exist(112)
texture object 112,5
endif
for f=114 to 120
if object exist(f)
texture object f,2
endif
next f
if upkey()=1 then move object 1,0.8
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-2.5)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+2.5)
if spacekey()=1 and playergrav#=0.0 then playergrav#=2.0
angle#=object angle y(1)
camdist#=25.0 : camhigh#=5.0 : camfade#=3
set camera to follow posx#,posy#-20,posz#,angle#,camdist#,camhigh#,camfade#,1
posx#=object position x(1)
posy#=object position y(1)
posz#=object position z(1)
cposx#=camera position x()
cposy#=camera position y()+10
cposz#=camera position z()
position object 2,cposx#,cposy#,cposz#
if object exist(120)
if x<=0
inc x,x=x+10
endif
if x>=100
dec x,x=x-10
endif
position object 120,-220,x,20
endif
playergrav#=playergrav#-0.1
posy#=posy#+playergrav#
if level1=1
if object exist(113)
if object collision (1,113)>0
for d=101 to 113
if object exist(d)
delete object d
endif
next d
gosub level2
endif
endif
endif
position object 1,posx#,posy#,posz#
if object collision(1,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
if get object collision y()<0 then playergrav#=0.0
endif
if object collision(2,0)>0
dec cposx#,get object collision x()
dec cposy#,get object collision y()
dec cposz#,get object collision z()
endif
position camera cposx#,cposy#,cposz#
position object 1,posx#,posy#,posz#
xrotate camera 15
sync
loop
Edit: Okay, so it didn't bold... but this is the code i'm using for the moving platforms, but it isn't working.
if object exist(120)
if x<=0
inc x,x=x+10
endif
if x>=100
dec x,x=x-10
endif
position object 120,-220,x,20
endif
Why do they turn against me? Especially when i need them the most?