T
TheRBZ
Guest
I have a script to automatically generate a 'forest' out of tree objects but I want to have a bare patch in the middle. I wanted to accomplish this tree-less patch in the middle by deleting the tree objects within a radius with collision_circle but my code seems to do nothing.
Mainly I'm looking to use 'with' and call to all the objects in the collision rather than one.
Any help? Thanks
Mainly I'm looking to use 'with' and call to all the objects in the collision rather than one.
Code:
///scr_generate_trees()
var xx;
var yy;
for (yy = 0; yy <= room_height; yy += 32;){ //do a vertical row
for (xx = 0; xx <= room_width; xx += 32 * (choose(1,2)); ){ //do a horizontal row
instance_create(xx,yy,obj_tree);
}
}
if collision_circle(room_width/2,room_height/2,32*4,obj_tree,false,true){
with(other){
instance_destroy();
}
}
/* ==================================================
This generates trees one horizontal line at a time
================================================== */