BMAP* bmp_temp;
function asteroid_modify(ENTITY* ast_i)
{
ast_i = ent_cloneskin(ast_i); // doesn't seem needed.
bmp_temp = ent_getskin(ast_i,1);
bmap_square_drawColor(bmp_temp, 255);
wait_for(bmp_square_drawColor);
ent_setskin(ast_i,bmap_temp,1);
set(ast_i,SHADOW);
cube_deform(ast_i, (100 + random(50)));
ast_i.scale_x = 0.05;
ast_i.scale_y= 0.05;
ast_i.scale_z = 0.05;
}
ENTITY* asteroid[200]; //initialize asteroid array
// Don't think you have to move the array to global but might be part of the problem.
function generate_asteroids()
{
int i;
for (i=0 ; i<200 ; i++)
{
asteroid[i] = ent_create("cube_small.mdl", vector(500,(0 + 20*i),0), NULL);
ent_clone(asteroid[i]);
wait(40);
//bmap_square_drawColor(texture2, 255); // why 2 calls?
asteroid_modify(asteroid[i]);
}
}