script_enemy_main
{
	#include_function ".\Bullet_function.txt"
	#include_function ".\Enemy function.txt"

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(200);
	SetScore(1000);
	SetDamageRate(100,33);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(256,128,320,192);
	Shot(GetArgument);
	Move();
	}

	@MainLoop{
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);
	ChackBonus;
	MagicPointReduce;
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	if(BeVanished() == false){
	MagicPointAddNormal(3);
	MagicPowerAdd(true);
	loop(4 + scorebonus){
	let x = GetX + rand(-32,32);
	let y = GetY + rand(-32,32);
	CreateItem(ITEM_SCORE,x,y);
	}
	}
	}

	task Shot(level){
	let angle = 90;
	loop{
	CreateShotSK2otama(GetX,GetY,level,1 + level * 0.5,1 * level,angle, 0.5);
	angle += 360 / (level + 2) * 2;
	loop(180 / (level * 2 + 4)){yield;}
	if(GetY >= 350){break;}
	}
	}

	task Move(){
	SetMovePosition02(GetX,GetClipMaxY+64,300);
	loop(301){yield;}
	VanishEnemy;
	}

}