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(0);
	SetY(0);
        SetDamageRate(100,100);
	LoadGraphic(imgEnemy);
	SetMovePositionHermite(rand(224,438),-10,1500,rand(30,60),400,rand(270,280),200);
	}

    @MainLoop {
		imgAngle+=4;
		if(imgAngle>360){imgAngle=0;}
	if(count>=10&&count%10==0){
		PlaySE(shotse);
        	SetShotDirectionType(PLAYER);
        	let shot01 = 1;
        	CreateShotA(shot01,GetX,GetY,10);
        	SetShotDataA(shot01,0,0.2,rand(-15,15),0,0.02,3,BLUE31);
        	FireShot(shot01);
		}
        	if(GetY<-5)
        	{
        		VanishEnemy();
        	}
        SetCollisionA(GetX(),GetY(),10);
        SetCollisionB(GetX(),GetY(),10);
        count++;
    }

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

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