Try sticking this in your main loop
` Enemy Collision with each other
colliding_objects=0
for x = 1 to Number_of_Enemies
for y = 1 to Number_of_Enemies
if x<>y
if object collision(x,y)=1
x2#=object position x(x)
z2#=object position z(x)
y2#=get ground height(World,x2#,z2#)
ay2#=object angle y(x)
inc colliding_objects,1
position object x,x1#,y2#+1,z1#+(object size(x)*colliding_objects)
move object left x,(EnemySpeed#*.5)
endif
endif
next x
next y
and before the main loop, replace this
for x = 1 to Number_of_Enemies
make object sphere x,1
EnemyState(x)=rnd(2) `By randomizing out of 2, we'll have some wandering, and some idle.
position object x,rnd(Size),1,rnd(Size) `Position our enemies randomly across the map
next x
with this
for x = 1 to Number_of_Enemies
make object sphere x,1
EnemyState(x)=rnd(2) `By randomizing out of 2, we'll have some wandering, and some idle.
position object x,rnd(Size),1,rnd(Size) `Position our enemies randomly across the map
set object collision on x
set object collision to spheres x
next x
Made a post on the CB forums with the full revised code.
A book? I hate book. Book is stupid.
(Formerly Yellow)