• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Want to make enemy that splits after death.

T

TBtub

Guest
So, I already have death of my enemy but I want to make him split. If anyone could help me, it would be great. My code for death:

if health_ <= 0 {
instance_destroy();
}
 

Psycho_666

Member
What do you mean split?
The first thing that pops in my mind is creating 2 other objects. So before you destroy the enemy you create the smaller enemies. so basically something like this:

if health<=0
{
instance_create(x,y,obj_split_1);
instance_create(x,y,obj_split_2);
instance_destroy();
}
 
T

TBtub

Guest
What do you mean split?
The first thing that pops in my mind is creating 2 other objects. So before you destroy the enemy you create the smaller enemies. so basically something like this:

if health<=0
{
instance_create(x,y,obj_split_1);
instance_create(x,y,obj_split_2);
instance_destroy();
}
This is exactly what I wanted :). Thanks a lot.
 
Top