Yeah
I have a suggestion though. If you are going to have all of the cubes the same size and you are going to move the same distance each loop like that ... it would be faster to do distance checks than object collision checks I would think.
I get 530 fps with this code
Sync on
Sync Rate 0
`Boxs
For x = 3 to 120
a# = Rnd(28) - 14
b# = Rnd(28) - 14
Make object cube x,0.5
Position object x,a#,0,b#
Color object x, rgb(0,0,255)
next x
`Table
Make Object Box 1,30,1,30
Position Object 1,0,-1,0
color object 1, rgb(0,255,0)
`Player
Make Object Cube 2,0.5
Color Object 2,rgb(255,0,0)
Playerx# = 0
Playery# = 0
Playerz# = 0
`Time
Time# = 0
Sync
`loop
Do
Time# = Time# + 1
Position Camera 0,12,-30
Point Camera 0,0,0
`Movement
Position object 2,playerx#,playery#,playerz#
If upkey() = 1 And time# = 5 then playerz# = Playerz# + 0.5
If downkey() = 1 And time# = 5 then playerz# = playerz# - 0.5
if rightkey() = 1 And time# = 5 then playerx# = playerx# + 0.5
if leftkey() = 1 And time# = 5 then playerx# = playerx# - 0.5
`Collisions NOT WORKING!
For X = 3 to 120
a# = object position x(x)
b# = object position z(x)
c# = object position x(2)
d# = object position z(2)
e = abs(c#-a#)
f = abs(d#-b#)
if e < .1 and f < .1 and rightkey() = 1 then position object x,a#+.5,0,b#
if e < .1 and f < .1 and leftkey() = 1 then position object x,a#-.5,0,b#
if e < .1 and f < .1 and upkey() = 1 then position object x,a#,0,b#+.5
if e < .1 and f < .1 and downkey() = 1 then position object x,a#,0,b#-.5
next x
If time# = 5 Then Time# = 0
Sync
Loop
Wait key
vs 460 FPS with this code
Sync on
Sync Rate 0
`Boxs
For x = 3 to 120
a# = Rnd(28) - 14
b# = Rnd(28) - 14
Make object cube x,0.5
Position object x,a#,0,b#
Color object x, rgb(0,0,255)
next x
`Table
Make Object Box 1,30,1,30
Position Object 1,0,-1,0
color object 1, rgb(0,255,0)
`Player
Make Object Cube 2,0.5
Color Object 2,rgb(255,0,0)
Playerx# = 0
Playery# = 0
Playerz# = 0
`Time
Time# = 0
Sync
`loop
Do
Time# = Time# + 1
Position Camera 0,12,-30
Point Camera 0,0,0
`Movement
Position object 2,playerx#,playery#,playerz#
If upkey() = 1 And time# = 5 then playerz# = Playerz# + 0.5
If downkey() = 1 And time# = 5 then playerz# = playerz# - 0.5
if rightkey() = 1 And time# = 5 then playerx# = playerx# + 0.5
if leftkey() = 1 And time# = 5 then playerx# = playerx# - 0.5
`Collisions NOT WORKING!
For X = 3 to 120
a# = object position x(x)
b# = object position z(x)
hit = object collision(2,x)
if hit = 1 and rightkey() = 1 then position object x,a#+.5,0,b#
if hit = 1 and leftkey() = 1 then position object x,a#-.5,0,b#
if hit = 1 and upkey() = 1 then position object x,a#,0,b#+.5
if hit = 1 and downkey() = 1 then position object x,a#,0,b#-.5
next x
If time# = 5 Then Time# = 0
Sync
Loop
Wait key
Also it is better to assign object collision(2,x) to a variable as it lags each time it is called.