/// @description Insert description here
// You can write your code in this editor
x=player.x
y=player.y-200
if hp>1300 then
{
//Первая фаза
timer+=1
if timer=60 then {instance_create_depth(x,y,-1,obj_v_bullet) timer=0 audio_play_sound(snd_shot,1,0)}
}
if hp>600 and hp<=1300 then
{
//Вторая фаза
timer+=1
if timer=90 then {instance_create_depth(x,y,-1,obj_u_bullet) timer=0 audio_play_sound(snd_shot,1,0)}
}
if hp<=600 then
{
//Третья фаза
timer+=1
if (timer mod 60)=0 then {instance_create_depth(x,y,-1,obj_v_bullet) audio_play_sound(snd_shot,1,0)}
if timer=420 then 
{ 
	timer=0
	enemy=irandom(5)
	if enemy=0 then instance_create_depth(x,y,2,obj_enemy_not_armored)
	if enemy=1 then instance_create_depth(x,y,2,obj_enemy_indian)
	if enemy=2 then instance_create_depth(x,y,2,obj_enemy_boom)
	if enemy=3 then instance_create_depth(x,y,2,obj_enemy_masked)
	if enemy=4 then instance_create_depth(x,y,2,obj_enemy_armored)
	if enemy=5 then instance_create_depth(x,y,2,obj_enemy_cyborg)
	}
}
if hp<0 then room_goto(room_reward)