script_enemy_main{
	let Enemy = GetCurrentScriptDirectory~"Enemy.png";
	let frame = rand_int(0, 10);
	let shot = GetCurrentScriptDirectory~"bounce.wav";
	#include_function ".\lib\SHOT_REPLACE\shot_replace.dnh";
	let death = GetCurrentScriptDirectory~"explode.wav";

	@Initialize{
	shotinit;
	LoadSE(shot);
	SetLife(30);
	LoadSE(death);
	 LoadGraphic(Enemy);
        SetTexture(Enemy);
        SetGraphicRect(4, 4, 26, 29);

	}

	@MainLoop {
	SetCollisionA(GetX, GetY, 10);
	SetCollisionB(GetX, GetY, 10);
	SetMovePosition02(GetX+10, GetY, 2);

	if(frame> rand_int(20, 30)){

	let a   = 0;
        let num = 15; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 3, a+GetAngleToPlayer, GREEN01, 10);
            a += 360/num;
	frame = rand_int(-10, 10);
	PlaySE(shot);

}

}

	if (GetY>500){VanishEnemy;}
	if (GetX>GetClipMaxX+10){VanishEnemy;}
	frame++;
	
	}

	 @DrawLoop {
        DrawGraphic(GetX, GetY);
    }
	 @Finalize {
	
	if(GetY<500 && GetX<GetClipMaxX+10){ PlaySE(death); loop(rand_int(1, 3)){
	CreateItem(ITEM_SCORE,GetX + rand(-20,20),GetY + rand(-20,20));
	}
    }
	}
	}