script_enemy_main {

let acc1 = 0;
let acc2 = 0;
let frame1 = 0;
let frame2 = 0;

let BossImage = GetCurrentScriptDirectory~"familiar.png";

let ShotSE = GetCurrentScriptDirectory~"ShotSE.wav";

@Initialize{
	LoadGraphic(BossImage);
	LoadSE(ShotSE);
	SetLife(10);
	SetMovePosition01(GetPlayerX, GetClipMaxY + 100, rand(3,6));
 }
@MainLoop{
    
	if (frame1 == 30)
        {
        CreateShot01(GetX, GetY, 1, 0 + rand(-5,5), 13, 0);
        CreateShot01(GetX, GetY, 1, 180 + rand(-5,5), 13, 0);
        CreateShot01(GetX, GetY, 2, 270 + rand(-5,5), 15, 0);
	acc1 += 27;
	frame1 = 0;
	PlaySE(ShotSE);
	}
	if (frame2 == 130)
        {
	SetLife(0);
	}
frame1++;
frame2++;
 }
@DrawLoop{
SetRenderState(ALPHA);
SetGraphicScale(1,1);
SetAlpha(255);
SetGraphicRect(0, 0, 66, 64);
SetTexture(BossImage);
SetGraphicAngle(0,0,acc2);
DrawGraphic(GetX, GetY);
acc2 += 10;
 }
@Finalize{
 }
}
