script_enemy_main
{
	let move = GetArgument;
	let frame = 0;
	let bee = GetCurrentScriptDirectory ~ "img\bee.png";
	
	@Initialize
	{
		LoadUserShotData(GetCurrentScriptDirectory ~ "supershot\supershot.txt");
		SetLife(500);
		SetInvincibility(60);
		LoadGraphic(bee);
		SetDamageRate(0,0);
	}

	@MainLoop
	{
		SetMovePosition02(GetCenterX + (150*cos(move)), GetCenterY-120 + (80*sin(move)), 0);
		SetCollisionA(GetX, GetY, 16);
		SetCollisionB(GetX, GetY, 8);
		if(frame==60){pew;}
		frame++;
		move++;
		yield;
	}
	
	@DrawLoop
	{
		SetTexture(bee);
		SetGraphicRect(0, 0, 110, 110);
		SetGraphicScale(0.5, 0.5);
		DrawGraphic(GetX, GetY);
	}

	@Finalize
	{
		DeleteGraphic(bee);
	}

	function Wait(frames){loop(frames){yield;}}
	
	task pew
	{
		rotate;
		Wait(180);
		aim;
	}
	
	task rotate
	{
		CreateShot02(GetX-10, GetY+18, 2, move+180, 0.02, 2.5, 15, 5);
		Wait(5);
		rotate;
	}
	
	task aim
	{
		PlaySE(GetCurrentScriptDirectory ~ "bgm\beesbees.wav");
		loop(40)
		{
			CreateShot02(GetX-10, GetY+18, 5, atan2(GetPlayerY - (GetY+18), GetPlayerX - (GetX-10)), -0.05, 3, 243, 5);
			Wait(2);
		}
		Wait(120);
		aim;
	}
}