script_enemy_main
{//Enemy22
        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(10);
        SetScore(10);
	SetX(GetClipMaxX);
	SetY(rand(100,250));
        SetDamageRate(100,100);
	LoadGraphic(imgEnemy);
	SetMovePosition01(GetClipMinX-310,GetY,3);
	}

    @MainLoop {
		imgAngle+=4;
		if(imgAngle>360){imgAngle=0;}
	if(count>=40&&count%50==0){
		PlaySE(shotse);
        	SetShotDirectionType(PLAYER);
        		let i = 0;
        		while( i < 7 )
        		{
        		let shot01 = 1;
        		CreateShotA(shot01,GetX,GetY,0);
        		SetShotDataA(shot01,0,2,i*10-30,0,-0.01,1.5,GREEN31);
        		FireShot(shot01);
        		i++;
        		}
		}
        	if(GetX<-10)
        	{
        		VanishEnemy();
        	}
        SetCollisionA(GetX(),GetY(),10);
        SetCollisionB(GetX(),GetY(),10);
        count++;
    }

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

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