Master Cabalist
Member
I'm sure how to do this exactly. What I want to do is send some meteors downward and kill the player's characters.
This is the code:
The meteors fall correctly. It is the instance_place(x,y,SentryBatObject) that isn't working proprely. I plan on replacing SentryBatObject to SpecialBrains (a catch all)
I have just realized instance_place won't do with what I want to do. I want to destroy all of the bats that get hit by the MeteorObjects. It is sufficient to destroy all bats
In one swoop, like what I thought I was doing above. Would this work:
I'm lost.
-TWRaven
This is the code:
GML:
timer_meteor_fall--;
meteor_timer--;
if (timer_meteor_fall <= 0) //how often a meteor attack occurs
{
//with (MeteorObjects)
//{
timer_meteor_fall = room_speed*15;
//}
if (meteor_timer <= 0)
{
instance_create_depth(0,y,-1200, MeteorObjects);
instance_create_depth(300,y,-1200, MeteorObjects);
instance_create_depth(600,y,-1200, MeteorObjects);
instance_create_depth(900,y,-1200, MeteorObjects);
instance_create_depth(1200,y,-1200, MeteorObjects);
y++;
if (y > 1000)
{
}
meteor_timer = room_speed*15;
}
}
//locate sentry (bat) then kill him
meteo = instance_place(x,y,SentryBatObject);
if (meteo != noone)
{
instance_destroy(meteo)
}
instance_destroy(meteo)
with (meteo)
{
instance_destroy()
}
I have just realized instance_place won't do with what I want to do. I want to destroy all of the bats that get hit by the MeteorObjects. It is sufficient to destroy all bats
In one swoop, like what I thought I was doing above. Would this work:
Code:
//locate sentry (bat) then kill him
meteo = instance_place(x,y,SpecialBrains);
if (meteo != noone)
{
instance_destroy(meteo)
}
instance_destroy(meteo)
with (meteo)
{
instance_destroy()
}
-TWRaven