script_enemy_main
{//Enemy11
        let count=0;
        let cx=GetCenterX();
        let cy=GetCenterY();
	let Animation=0;
        let r = 0;
        let csd     = GetCurrentScriptDirectory;
        let imgBoss2 =csd~"img\dot_yousei.png";
	let angle=0;
	let shotseB = csd~"se\ShotSE01.wav";

    @Initialize {
        SetLife(50);
        SetScore(10);
        SetDamageRate(0,0);
        SetX(GetX);
        SetY(GetY);
	SetMovePosition02(GetX,100,30);
	LoadGraphic(imgBoss2);
        TAnime;
    }

    @MainLoop {
	if(count==50){
        SetDamageRate(100,100);
	SetMovePosition01(500,120,1.5);
		}
        if(count>=30&&count%60==30)
        	{
		PlaySE(shotseB);
		angle=rand(0,360);
		let i=0;
		while(i<36)
		{
                SetShotDirectionType(ABSOLUTE);
        	let shot01 = 1;
        	CreateShotA(shot01,GetX(),GetY(),0);
        	SetShotDataA(shot01,0,5,angle+i*10,0,-0.1,0,BLUE12);
                SetShotDirectionType(PLAYER);
        	SetShotDataA(shot01,50,2,i*10,0,0,0,BLUE21);
        	FireShot(shot01);
                SetShotDirectionType(ABSOLUTE);
        	CreateShotA(shot01,GetX(),GetY(),3);
        	SetShotDataA(shot01,0,4.5,angle+i*10,0,-0.1,0,BLUE12);
                SetShotDirectionType(PLAYER);
        	SetShotDataA(shot01,50,2,i*10,0,0,0,BLUE21);
        	FireShot(shot01);
                SetShotDirectionType(ABSOLUTE);
        	CreateShotA(shot01,GetX(),GetY(),6);
        	SetShotDataA(shot01,0,4,angle+i*10,0,-0.1,0,BLUE12);
                SetShotDirectionType(PLAYER);
        	SetShotDataA(shot01,50,2,i*10,0,0,0,BLUE21);
        	FireShot(shot01);
                SetShotDirectionType(ABSOLUTE);
        	CreateShotA(shot01,GetX(),GetY(),9);
        	SetShotDataA(shot01,0,3.5,angle+i*10,0,-0.1,0,BLUE12);
                SetShotDirectionType(PLAYER);
        	SetShotDataA(shot01,50,2,i*10,0,0,0,BLUE21);
        	FireShot(shot01);
                SetShotDirectionType(ABSOLUTE);
        	CreateShotA(shot01,GetX(),GetY(),12);
        	SetShotDataA(shot01,0,3,angle+i*10,0,-0.1,0,BLUE12);
                SetShotDirectionType(PLAYER);
        	SetShotDataA(shot01,50,2,i*10,0,0,0,BLUE21);
        	FireShot(shot01);
		i++;
		}
        	}
        	if(GetX<-10||GetX>458||GetY>490||GetY<-10)
        	{
        		VanishEnemy();
        	}
        SetCollisionA(GetX(),GetY(),10);
        SetCollisionB(GetX(),GetY(),10);
        count++;
        yield;
    }

        @DrawLoop {
		SetTexture(imgBoss2);
		if(int(GetSpeedX())==0)
		{SetGraphicRect(Animation*32,64,31+Animation*32,94)}
		else if(GetSpeedX()>0){SetGraphicRect(128+Animation*32,95,159+Animation*32,126);}
		else if(GetSpeedX()<0){SetGraphicRect(Animation*32,95,31+Animation*32,126);}
		DrawGraphic(GetX(),GetY());
	}

        @Finalize
        {
		if(!BeVanished){CreateItem(ITEM_SCORE,GetX,GetY);}
        }

    	task TAnime{
		loop{
			Animation=0;
        		loop(10){yield;}
			Animation=1;
        		loop(10){yield;}
			Animation=2;
        		loop(10){yield;}
			}
		}
}