script_enemy_main{
let D	= GetCurrentScriptDirectory;
let imgFam = D ~ "system\Familiar1.png";
let s1 = D ~ "Shot.wav";
@Initialize{
    SetLife(200);
    LoadGraphic(imgFam);
    LoadSE(s1);
    fire;
 }
@MainLoop{
	SetCollisionA(GetX,GetY,16);
	SetCollisionB(GetX,GetY,16);
	yield;
 }
@DrawLoop{
	SetTexture(imgFam);
	SetRenderState(ALPHA);
	SetAlpha(255);
	SetGraphicRect(0,0,88,90);
	SetGraphicScale(0.5,0.5);
	SetGraphicAngle(0,0,0);
	DrawGraphic(GetX,GetY);
 }
@Finalize{DeleteSE(s1);
CreateItem(ITEM_SCORE,GetX,GetY);
}
	task fire{
		let dir = GetAngleToPlayer;
		loop{
			loop(36){CreateShot01(GetX,GetY,6,dir,RED04,0); dir+=10 }
			dir+=rand(0,356);
			PlaySE(s1);
		wait(2);
		}
	}
	function wait(w){loop(w){yield;}}
}
}