Ok that's fine, but I suggest you learn about arrays, they're not that hard to use, think of an array as a filing cabinet for variables.
each drawer in the cabinet has any number of containers in it, for now that's all we need.
So an array can be
dim testarray(1)
that has 2 'drawers', numbered 0 and 1
dim testarray(1,5)
this one has 2 drawers, each with 6 tupperware containers in it.
So if you think about it, you can make an array where the 1st dimension is the drawer which holds 3 coordinates in a tupperware container(second dimension)
We need 230 drawers because that's how many boxes you're making.
Inside each drawer we have a container with the coordinate variables for each box in it.
So add to your code:
dim collision_boxes#(230,2)
for i = 20 to 250
make object cube i,50
position object i,rnd(5000),25,rnd(5000)
x#=object position x(i)
y#=25
z#=object position z(i)
MAKE STATIC COLLISION BOX x#-25,y#-25,z#-25,x#+25,y#+25,z#+25
`our array starts at 0, but the boxes start at 20, so:
box=i-20
`now we store the coordinates into our array. We only need the `positions as the `boxes are all the same size:
collision_boxes#(box,0)=x#
collision_boxes#(box,1)=y#
collision_boxes#(box,2)=z#
`make the box static and delete the object
make static object i
delete object i
next i
Now whenever you need to extract the info for where the boxes are:
(you can consider the collision boxes as numbered from 0 to 230)
for collision_box=0 to 230
x#=collision_boxes#(collision_box,0)
y#=collision_boxes#(collision_box,1)
z#=collision_boxes#(collision_box,2)
`now do the calculations based on the offsets (+/-25) from these `variables
`for each collision_box you want to check
next collision_box
I also realized you didn't quite understand how the static objects work, you can delete the object after you make it static, otherwise there's not really much point to using the static collision box
Hope that's not too complex
ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.