script_enemy_main
{//Enemy21
        let count=rand_int(0,39);
        let csd     = GetCurrentScriptDirectory;
	let imgEnemy=csd~"img\dot_kedama.png";
	let imgAngle=0;
	let shotse = csd~"se\ShotSE02.wav";

    @Initialize {
        SetLife(20);
        SetScore(10);
	SetX(448);
	SetY(0);
        SetDamageRate(100,100);
	LoadGraphic(imgEnemy);
	SetMovePositionHermite(rand(10,224),-10,1500,rand(120,150),400,rand(260,270),200);
	}

    @MainLoop {
		imgAngle+=4;
		if(imgAngle>360){imgAngle=0;}
	if(count>=10&&count%10==0){
		PlaySE(shotse);
        	SetShotDirectionType(PLAYER);
        		let i = 0;
        		while(i<5)
        		{
        		let shot01 = 1;
        		CreateShotA(shot01,GetX(),GetY(),10);
        		SetShotDataA(shot01,0,2,-14+i*7,0,0.02,3,RED31);
        		FireShot(shot01);
        		i++;
        		}
		}
        	if(GetY<-5)
        	{
        		VanishEnemy();
        	}
        SetCollisionA(GetX(),GetY(),10);
        SetCollisionB(GetX(),GetY(),10);
        count++;
    }

        @DrawLoop {
		SetGraphicRect(54,0,80,26);
		SetTexture(imgEnemy);
		SetColor(255,255,255);
		SetRenderState(ALPHA);
		SetGraphicAngle(0,0,imgAngle);
		DrawGraphic(GetX(),GetY());
	}

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