script_enemy_main {

let a1 = 0;
let a2 = 0;
let acc1 = 0;
let acc2 = 0;
let acc3 = 0;
let frame1 = 0;
let frame2 = 0;

let BossImage = GetCurrentScriptDirectory~"sup\Nuke3.png";
let BossImage2 = GetCurrentScriptDirectory~"sup\Nuke1.png";

let ShotSE = GetCurrentScriptDirectory~"se\Boon1.wav";

 function TWait(let frames){
   loop(frames){yield;}
 }

@Initialize{
	LoadGraphic(BossImage);
	LoadGraphic(BossImage2);
	LoadSE(ShotSE);
	SetLife(10);
 }
@MainLoop{
SetCollisionB(GetX, GetY, 125);
    
	if (frame1 == 100 || frame1 == 400 || frame1 == 700)
        {
SetMovePosition03(GetPlayerX, GetPlayerY, 30, 2);
	PlaySE(ShotSE);
	}
	if (frame1 == 1200)
        {
	frame1 = 1;
	}
frame1++;
frame2++;
yield;
 }
@DrawLoop{
SetColor(5,5,255);
SetRenderState(ALPHA);
SetTexture(BossImage2);
SetGraphicScale(1.4+acc3,1.4+acc3);
SetGraphicRect(0, 0, 256, 256);
SetAlpha(255);
DrawGraphic(GetX, GetY);

SetColor(255,255,255);

SetRenderState(ADD);
SetGraphicScale(0.8,0.8);
SetAlpha(255);
SetGraphicRect(0, 0, 435, 435);
SetTexture(BossImage);
SetGraphicAngle(0,0,acc2);
DrawGraphic(GetX, GetY);
acc1 += 10;
acc3 = 0.1*cos(acc1);
acc2 += rand(-360,360);
 }
@Finalize{
 }
}
