script_enemy_main {

let frame1 = 0;
let frame2 = 0;
let frame3 = 0;
let frame4 = 0;
let frame5 = 0;
let frame6 = 0;
let frame7 = 0;
let frame8 = 0;
let frame9 = 0;
let frame10 = 0;
let frame11 = 0;
let anim1 = 0;
let anim2 = 0;
let anim3 = 0;
let a1 = 0;
let a2 = 0;
let a3 = 0;
let a4 = 0;
let a5 = 0;
let a6 = 0;
let a7 = 0;
let a8 = 0;
let acc1 = 0;
let acc2 = 0;
let acc3 = 0;
let acc4 = 0;
let acc5 = 0;
let acc6 = 0;
let acc7 = 0;
let acc8 = 0;
let acc9 = 0;
let acc10 = 0;
let acc11 = 0;
let acc12 = 0;
let random1 = 0;
let RE = 0;
let angle=GetAngleToPlayer;
let SP = GetCurrentScriptDirectory~"sp\sp.png";
let Custom = GetCurrentScriptDirectory~"sup\supershot.txt";
let sh1 = GetCurrentScriptDirectory~"se\BulletWave.wav";
let sh2 = GetCurrentScriptDirectory~"se\Weird2.wav";

    @Initialize {
SetMovePosition01(GetX, GetCenterY-100, 2);
LoadUserShotData(Custom);
LoadSE(sh1);
LoadSE(sh2);

SetLife(600);
    }

    @MainLoop {
	SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 24);
	if (frame2 < 1780){
		 if (frame2 == 60){angle=GetAngleToPlayer;}
        if (frame1 > 30)
        { 
        CreateShot01(GetX,GetY,5,angle+30-20*sin(3*frame2),124,5);
		CreateShot01(GetX,GetY,5,angle-30+20*sin(3*frame2),124,5);
	PlaySE(sh1);
	a1 += 10;
	frame1 = 27;
        }}
	if (frame2 == 1780){
PlaySE(sh2);
SetMovePosition01(GetClipMinX - 3000, GetClipMinY - 500, 30);
}
	if (frame2 == 1800){VanishEnemy;}
        frame1++;
        frame2++;
        frame3++;
        frame4++;
	if (OnPlayerMissed == true){RE = 1;}
	if (OnBomb == true){RE = 1;}
	acc4 += 1;
    }

    @DrawLoop {
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(224, 257, 256, 287);
SetAlpha(255);
DrawGraphic(GetX, GetY);

SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,-acc1);
SetGraphicScale(1,1);
SetGraphicRect(224, 287, 256, 321);
SetAlpha(255);
DrawGraphic(GetX, GetY);

SetTexture(SP);
SetRenderState(ADD);
SetGraphicAngle(0,0,acc2);
SetGraphicScale(1.3,1.3);
SetGraphicRect(224, 287, 256, 321);
SetAlpha(255);
DrawGraphic(GetX, GetY);

acc1 += 13;
acc2 += 9;
anim1++;
 }
    @Finalize {
}
    }
}
