function shoot_1_event()
{
shoot_1(i);
wait(35);
i++;
}
function shoot_1(i)
{
//if(shoot_var == 1)
//{
// shoot_var = 0;
snd_play(laser, 90, 0);
_shoot[i] = pan_create("bmap = shot.bmp;",5);
_shoot[i].pos_x = _ship.pos_x+30 - bullet_width / 2;
_shoot[i].pos_y = _ship.pos_y-20;
_shoot[i].flags |= VISIBLE;
// shoot_var = 1;
while(_shoot[i] != NULL)
{
if(_shoot[i].pos_y > 5)
{
_shoot[i].pos_y -= 1;
}
else
{
reset(_shoot[i],VISIBLE);
break;
}
if ((((_shoot[i].pos_x + bullet_width >= enemies[i_2].pos_x) && (_shoot[i].pos_x + bullet_width <= enemies[i_2].pos_x + enemy_width)) ||
((enemies[i_2].pos_x + enemy_width >= _shoot[i].pos_x) && (enemies[i_2].pos_x + enemy_width <= _shoot[i].pos_x + bullet_width)))
&& (((_shoot[i].pos_y + bullet_height >= enemies[i_2].pos_y) && (_shoot[i].pos_y + bullet_height <= enemies[i_2].pos_y + enemy_height)) ||
((enemies[i_2].pos_y + enemy_height >= _shoot[i].pos_y) && (enemies[i_2].pos_y + enemy_height <= _shoot[i].pos_y + bullet_height))))
{
score += 20;
snd_play(explo, 90, 0);
reset(_shoot[i], VISIBLE);
_shoot[i] = NULL;
enemies[i_2].bmap = explo1_tga;
wait (6);
enemies[i_2].bmap = explo2_tga;
wait (6);
enemies[i_2].bmap = explo3_tga;
wait (6);
enemies[i_2].bmap = explo4_tga;
wait (6);
reset(enemies[i_2], VISIBLE);
create_enemy(i_2);
}
wait(1);
}
_shoot[i] = NULL;
//}
}