Kill them all! Help me out
Could someone give me a hand? I'm kinda stuck.
I've created a boss room, the boss creates more enemy sprites during the fight but when the fight's over I want them to die too. That's the problem. Anyone know a script I can use to kill all enemy sprites in the boss room while the boss is dead?
I've created a boss room, the boss creates more enemy sprites during the fight but when the fight's over I want them to die too. That's the problem. Anyone know a script I can use to kill all enemy sprites in the boss room while the boss is dead?
This isn't a very nice way to do it IMO, but it's the first/simplest one I thought of. If you want to kill them in some specific way, say so.
loop:
int &thong = get_sprite_with_this_brain(9,-1) == 1)
if (&thong != 0)
{
hurt(&thong, 9999);
wait(10);
goto loop;
}
loop:
int &thong = get_sprite_with_this_brain(9,-1) == 1)
if (&thong != 0)
{
hurt(&thong, 9999);
wait(10);
goto loop;
}
This should work...
//sample
int &sprite = 0;
getsprite:
wait(1);
&sprite = get_next_sprite_with_this_brain(9, 0, &sprite);
if (&sprite > 0)
{
int &junk = is_script_attached(&sprite);
if (&junk > 0)
{
sp_kill(&sprite, 1);
//or the hurt thing might work well too
}
&sprite += 1;
goto getsprite;
}
//sample
int &sprite = 0;
getsprite:
wait(1);
&sprite = get_next_sprite_with_this_brain(9, 0, &sprite);
if (&sprite > 0)
{
int &junk = is_script_attached(&sprite);
if (&junk > 0)
{
sp_kill(&sprite, 1);
//or the hurt thing might work well too
}
&sprite += 1;
goto getsprite;
}