script_enemy_main
{
	let sapz = GetCurrentScriptDirectory ~ "img\suiy.png";
	let sapzlol = GetCurrentScriptDirectory ~ "img\suiyz.png";
	
	let frame = 0;
	
	@Initialize
	{
		LoadUserShotData(GetCurrentScriptDirectory ~ "supershot\supershot.txt");
		
		LoadGraphic(sapz);
		LoadGraphic(sapzlol);
		
		SetLife(1337);
		SetScore(2000000);
		SetInvincibility(60);
		MagicCircle(false);
		SetRateScoreSystemEnable(false);
		SetEnemyMarker(true);
		PlayMusic(GetCurrentScriptDirectory ~ "bgm\bees.mp3");
		SetMovePosition02(GetCenterX, GetCenterY - 120, 10);
	}

	@MainLoop
	{
		SetCollisionA(GetX, GetY, 32);
		SetCollisionB(GetX, GetY, 16);
		Bombimmunity;
		if(frame==60){pew;}
		if(GetPlayerLife==1){VanishEnemy;}
		
		frame++;
		yield;
	}
	
	@DrawLoop
	{
		if(OnBomb)
		{
			SetTexture(sapzlol);
			SetGraphicRect(0, 0, 500, 500);
			SetGraphicAngle(0, 0, frame*10);
			SetGraphicScale(0.25, 0.25);
			DrawGraphic(GetX, GetY);
		}
		else
		{
			SetTexture(sapz);
			SetGraphicRect(0, 0, 250, 250);
			SetGraphicAngle(0, 0, 0);
			SetGraphicScale(0.5, 0.5);
			DrawGraphic(GetX, GetY);
		}
	}

	@Finalize
	{
	}

	function Wait(frames){loop(frames){yield;}}
	
	sub Bombimmunity
	{
		if(OnBomb)
		{
			SetDamageRate(0,0);
		}
		else
		{
			SetDamageRate(100, 0);
		}
	}
	
	sub pew
	{
		summonbee;
		movement;
	}
	

	task summonbee
	{
		CreateEnemyFromFile(GetCurrentScriptDirectory~"bee2.txt", rand(150,298), rand(50,GetY), 3, 90, 0);
		PlaySE(GetCurrentScriptDirectory ~ "bgm\beesbees.wav");
		Wait(30);
		summonbee;
	}
	
	task movement
	{
		Wait(60);
		SetMovePositionRandom01(rand(5,10), rand(5,10), rand(0.5,1), 150, 150, 298, GetCenterY-100);
		movement;
	}
}