Please change all your variable names, they are meaningless.
It's good that you indent, and you do it correctly (apart from the "move to lane" parts that didn't need indenting), but why do you indent three spaces? Is this what your text editor does for a tab? It's not a real problem but just odd to me as the standard is usually four or two spaces.
Don't be afraid to use lots of whitespace, it really helps improve readability:
do
bl = wrapvalue(object angle y(1)-15)
g_l1t = g_l1t+1
g_l2t = g_l2t+1
t = t + 1
if t < 0 then t = 0
tf_out = time_update(t,30)
rotate object 1,0,bl,90
center text 400,0,"Score: "+str$(g_score)
center text 325,350,str$(tf_out)+"%"
scroll object texture 2,0,-0.01
position object 1,camera position X(),camera position Y()-500,camera position Z()+990
REM move to lane 1
if leftkey()=1 and g_clane = 2 then g_chtolane = 1
if g_chtolane = 1 then position camera camera position x()-20,camera position y(),camera position z()
if g_chtolane = 1 and camera position X()<-190 then g_chtolane=0:g_clane=1
REM move to lane 2
if rightkey()=1 and g_clane = 1 then g_chtolane = 2
if g_chtolane = 2 then position camera camera position x()+20,camera position y(),camera position z()
if g_chtolane = 2 and camera position X()>190 then g_chtolane=0:g_clane=2
REM create lane 1 objects
if rnd(30)=1 and lanetimer(g_l1t)>0.7
g_icount = 10
for g_icount = 10 to 19
if object exist(g_icount) <>1
g_l1t = 0
make object cube g_icount,75
position object g_icount,-200,1000,990
bl=rnd(99)+1
if bl < 61 then color object g_icount,rgb(255,0,0):g_cubetype(g_icount-10)=0
if bl > 60 and bl < 96 then color object g_icount,rgb(0,255,0):g_cubetype(g_icount-10)=1
if bl > 95 then color object g_icount,rgb(0,0,255):g_cubetype(g_icount-10)=2
make object collision box g_icount,-37,-37,-37,37,37,37,1:set object collision on g_icount
g_icount = 20
endif
next g_icount
endif
REM create lane 2 objects
if rnd(30)=1 and lanetimer(g_l2t)>0.7
g_icount = 20
for g_icount = 20 to 29
if object exist(g_icount) <>1
g_l2t = 0
make object cube g_icount,75
position object g_icount,200,1000,990
bl=rnd(99)+1
if bl < 61 then color object g_icount,rgb(255,0,0):g_cubetype(g_icount-10)=0
if bl > 60 and bl < 96 then color object g_icount,rgb(0,255,0):g_cubetype(g_icount-10)=1
if bl > 95 then color object g_icount,rgb(0,0,255):g_cubetype(g_icount-10)=2
make object collision box g_icount,-37,-37,-37,37,37,37,1:set object collision on g_icount
g_icount = 10
endif
next g_icount
endif
REM move objects/collision
g_icount = 10
for g_icount = 10 to 29
if object exist(g_icount)=1:REM collision
if object collision(1,g_icount)>0
if g_cubetype(g_icount-10)=0 then t=t+500
if g_cubetype(g_icount-10)=1 then g_score=g_score + 100
if g_cubetype(g_icount-10)=2 then t=t-500:g_score=g_score+500
delete object g_icount
endif
endif
if object exist(g_icount) = 1
position object g_icount,object position x(g_icount),object position y(g_icount)-21,object position z(g_icount)
if object position y(g_icount)<-1000 then delete object g_icount
endif
next g_icount
loop
I've tidied up your code a bit. Nothing major changed.
do
`// INPUT //
REM move to lane 1
if leftkey() and lane = 2 or changeLane = 1
changeLane = 1
position camera camera position x()-20, camera position y(), camera position z()
if camera position X() < -190 then changeLane = 0 : lane = 1
endif
REM move to lane 2
if rightkey() and lane = 1 or changeLane = 2
changeLane = 2
position camera camera position x()+20, camera position y(), camera position z()
if camera position X() > 190 then changeLane = 0 : lane = 2
endif
`// PROCESS //
bl = wrapvalue(object angle y(1)-15)
timerLane1 = timerLane1 + 1
timerLane2 = timerLane2 + 1
t = t + 1
if t < 0 then t = 0
tf_out = time_update(t,30)
rotate object 1, 0, bl, 90
position object 1, camera position X(), camera position Y()-500, camera position Z()+990
scroll object texture 2,0,-0.01
REM create objects in lane 1 at random (try to describe what the code is specifically doing)
if rnd(30) = 1 and lanetimer(timerLane1)>0.7
for i = 10 to 19
if object exist(i) <>1
timerLane1 = 0
make object cube i,75
position object i,-200,1000,990
bl= rnd(99)+1
if bl < 61
color object i,rgb(255,0,0)
cubetype(i-10) = 0
endif
if bl > 60 and bl < 96
color object i,rgb(0,255,0)
cubetype(i-10) = 1
endif
if bl > 95
color object i,rgb(0,0,255)
cubetype(i-10) = 2
endif
make object collision box i,-37,-37,-37,37,37,37,1:set object collision on i
exit `// jumps out of the deepest loop
endif
next i
endif
REM create lane 2 objects
`// code removed because it is identical to lane one, if we restructure we can make a system
`// that uses the same block of code for any number of lanes!
REM move objects/collision
for i = 10 to 29
if object exist(i)
if object collision(1,i) > 0
if cubetype(i-10)=0 then inc t,500
if cubetype(i-10)=1 then score = score + 100
if cubetype(i-10)=2 then dec t,500 : score = score + 500
delete object i
endif
endif
if object exist(i)
position object i, object position x(i), object position y(i)-21, object position z(i)
if object position y(i) < -1000 then delete object i
endif
next i
`// OUTPUT //
center text 400, 0, "Score: " + str$(score)
center text 325, 350, str$(tf_out) + "%"
loop
What's up with this "g_" naming convention? I removed it because it's ugly and unnecessary. As personal preference I never use underscores as they don't always display clearly, I use camelCase instead, but that's a personal style choice.
A FOR loop declares the count variable at the starting value, you don't need to set it beforehand. A count variable is one time that you don't need a descriptive name, "i" will do just fine on its own.
In conditions you don't need to specify a truth value, conditions always test for truth. IE
if spacekey()=1 ... is the same as
if spacekey() ... Truth is any non-zero value, not just one.
Every program is divided into INPUT >> PROCESS >> OUTPUT sections, it helps to label these, as I've done, when you're learning. Obeying this structure keeps the logical order of your program easy to follow, ie you will get fewer bugs and unexpected behaviours.

Formerly OBese87.