int int_invaderCount;
ENTITY* ent_invader[3]; //change 3 to max invaders as required
function game_over()
{
if((event_type == EVENT_IMPACT) || (event_type == EVENT_ENTITY))
{
wait(1);
g_over = 1;
ent_remove(t_bod);
ent_remove(t_gun);
int i;
for(i = 0; i < int_invaderCount; i++){
ent_remove(ent_invader[i]);
ent_invader[i] = NULL;
}
ent_create("invader_over.mdl", vector (1000, 50, 20), NULL); //create lose frame
}
}
action invader_attack()
{
var attack = 0;
set(my, PASSABLE);
while(my)
{
wait(-1);
}
}
action invader_move()
{
ent_invader[int_invaderCount] = me; //store each invader
c_setminmax(me);
my.event = game_over;
my.emask |= ENABLE_ENTITY;
int_invaderCount++;
while(me)
{
my.pan += 0.7;
c_move (my, vector(imix, imiy, imiz), vector(imiax, imiay, imiaz), IGNORE_PASSABLE); // move the invader according to the ai action
wait(1);
}
}