I
iBack
Guest
Hi, I am having a hard time figuring out how to destroy multiple instances on collision. At the moment I have a second attack (right_click) object called "water_balloon_test" the size of this sprite and collision mask is full 300 x 300. On collision with enemy it only destroys whatever instance that is in the surrounding area of the collision, however the "water_balloon_test" instance does not get destroyed once on collision.
What I want is, once "water_balloon_test" collides, multiple instances in that area of collision gets destroyed, along with the "water_balloon_test" instance.
I am unsure what to use, i'm new to gamer maker studio and currently trying to create a game.
what would i do? please help.
this is what i have inside the collision event:
[COLLISION]
What I want is, once "water_balloon_test" collides, multiple instances in that area of collision gets destroyed, along with the "water_balloon_test" instance.
I am unsure what to use, i'm new to gamer maker studio and currently trying to create a game.
what would i do? please help.
this is what i have inside the collision event:
[COLLISION]
Code:
//with statement so this applies to another object other than the one we are using, moreover, other so it applies to individual objects instead of all.
with (other)
{
if (instance_nearest (x,y,obj_enemy))
{
hp = hp - 5; //since the enemy health is set to 5 hits, the one right_click attack would kill the enemy with one hit
}
instance_destroy();//currently destroys all instances the object collides with but doesn't get destroyed itself.
}
instance_destroy(); // if i place this here it will destroy the "water_balloon"test" instance and one enemy instance but not multiple instances in the surrounding area.
Last edited by a moderator: