script_enemy_main{
let D = GetCurrentScriptDirectory;
let imgFam = D ~ "system\Familiar1.png";
let s1 = D ~ "Shot.wav";
let shot = D ~ "supershot.txt";
@Initialize{
    SetLife(200);
    LoadGraphic(imgFam);
    LoadUserShotData(shot);
    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,10,dir,rand_int(1,300),0); dir+=10; }
		PlaySE(s1);
		wait(2);
		dir=GetAngleToPlayer;
		}
	}
	function wait(w){loop(w){yield;}}
}