Yep 'tis the way to go, though there are doubters
`Simple global array/function passing by Danmatsuma
`A really stoopid use of said functionality
`but shows passing of multiple variables from a function using an array
sync on
MAXobjects=20
dim posinfo#(MAXobjects,2)
for ob=1 to 20
make object cube ob,20
color object ob,rgb(rnd(255),rnd(255),rnd(255))
ghost object on ob
next ob
move camera -200
do
`hehe, you'd really just put the position object code in
`the function in practice, but I'm showing you how to
`pass variables from a function aint I!!
for objectNUM=1 to MAXobjects
change_position_info(objectNUM)
x#=posinfo#(objectNUM,0)
y#=posinfo#(objectNUM,1)
z#=posinfo#(objectNUM,2)
position object objectNUM,x#,y#,z#
next objectNUM
point camera x#,y#,z#
sync
loop
`here's the function utilizing the global array
function change_position_info(objectNUM)
x#=posinfo#(objectNUM,0)
y#=posinfo#(objectNUM,1)
z#=posinfo#(objectNUM,2)
move=rnd(3)
if move=1
inc x#,rnd(1)
inc y#,rnd(1)
inc z#,rnd(1)
endif
posinfo#(objectNUM,0)=x#
posinfo#(objectNUM,1)=y#
posinfo#(objectNUM,2)=z#
endfunction
It'll just make something that looks like diffracted light shining through a small hole, in other words a bunch of jittery ghosted boxes on an angle
ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.